public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* ~OT: any proposals to add provision for binary integer values
@ 2007-06-13 12:36 Shriramana Sharma
  2007-06-13 21:15 ` Brian Dessent
  2007-06-14  4:09 ` Lawrence Crowl
  0 siblings, 2 replies; 4+ messages in thread
From: Shriramana Sharma @ 2007-06-13 12:36 UTC (permalink / raw)
  To: gcc-help

Hello, this is slightly OT but since I got information on recent 
proposals to improve C++ in this list, I presume there are people here 
well informed on such matters and so ask.

Please CC me in all replies as I am currently not on the list.

In C/C++ we have provision for typing into code decimal, octal and 
hexadecimal integer values:

1000
01750
0x3E8

which all mean the same. But we are not allowed to use binary values:

0b1111101000

So I wonder if this can be included into a future standard of both C and 
C++. Does anyone know if this has already been suggested and accepted?

Shriramana Sharma.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ~OT: any proposals to add provision for binary integer values
  2007-06-13 12:36 ~OT: any proposals to add provision for binary integer values Shriramana Sharma
@ 2007-06-13 21:15 ` Brian Dessent
  2007-06-20 16:36   ` Shriramana Sharma
  2007-06-14  4:09 ` Lawrence Crowl
  1 sibling, 1 reply; 4+ messages in thread
From: Brian Dessent @ 2007-06-13 21:15 UTC (permalink / raw)
  To: Shriramana Sharma; +Cc: gcc-help

Shriramana Sharma wrote:

> which all mean the same. But we are not allowed to use binary values:
> 
> 0b1111101000
> 
> So I wonder if this can be included into a future standard of both C and
> C++. Does anyone know if this has already been suggested and accepted?

This feature was actually added to gcc 4.3 back in April, after sitting
around in various patch forms for nearly two years.  If you read the
thread, it is hoped that having this feature in a popular production
compiler will inspire the standards bodies to adopt it in the future,
where they have previously dismissed it as unnecessary.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23479
http://gcc.gnu.org/ml/gcc-patches/2007-04/msg01458.html

Brian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ~OT: any proposals to add provision for binary integer values
  2007-06-13 12:36 ~OT: any proposals to add provision for binary integer values Shriramana Sharma
  2007-06-13 21:15 ` Brian Dessent
@ 2007-06-14  4:09 ` Lawrence Crowl
  1 sibling, 0 replies; 4+ messages in thread
From: Lawrence Crowl @ 2007-06-14  4:09 UTC (permalink / raw)
  To: Shriramana Sharma; +Cc: gcc-help

On 6/11/07, Shriramana Sharma <samjnaa@gmail.com> wrote:
> So I wonder if [binary integer literals] can be included into a future
> standard of both C and C++. Does anyone know if this has already
> been suggested and accepted?

To my knowledge there is no such proposal before the C++ committee
and given the very short schedule remaining, any such proposal
needs to be presented to the committee within about two weeks.

The C committee is just starting to consider a new version of its
standard.

-- 
Lawrence Crowl

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ~OT: any proposals to add provision for binary integer values
  2007-06-13 21:15 ` Brian Dessent
@ 2007-06-20 16:36   ` Shriramana Sharma
  0 siblings, 0 replies; 4+ messages in thread
From: Shriramana Sharma @ 2007-06-20 16:36 UTC (permalink / raw)
  To: gcc-help

Brian Dessent wrote:

> This feature was actually added to gcc 4.3 back in April, 

Just remarking that to complement this feature, we would like to have a 
%b conversion specifier for printf in libc. When gcc 4.3 comes out (or 
am I not up to date) I can use that as a precedent to request such a 
feature for libc.

Shriramana Sharma.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-06-20 12:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-13 12:36 ~OT: any proposals to add provision for binary integer values Shriramana Sharma
2007-06-13 21:15 ` Brian Dessent
2007-06-20 16:36   ` Shriramana Sharma
2007-06-14  4:09 ` Lawrence Crowl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).