public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Proposal
@ 2001-09-17  8:55 Thomas R. Truscott
  0 siblings, 0 replies; 45+ messages in thread
From: Thomas R. Truscott @ 2001-09-17  8:55 UTC (permalink / raw)
  To: gcc

Perhaps http://gcc.gnu.org/projects/ is appropriate for your proposals.
Perhaps that page should be subdivided
into bug fixes, optimizations, language extensions, etc.

I'm puzzled by the argument against _ as separator in numbers,
that 1000000000000 can be written 1000 * 1000 * 1000 * 1000.
In addition to operator precedence hazard,
the following typically results in a negative value in x:

   long long x = 1000 * 1000 * 1000 * 1000;

(Were you just having fun? :-)

Tom Truscott

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

* Re: Proposal
  2013-06-26 18:15 ` Proposal Paolo Carlini
@ 2013-06-26 18:40   ` Daniel Santos
  0 siblings, 0 replies; 45+ messages in thread
From: Daniel Santos @ 2013-06-26 18:40 UTC (permalink / raw)
  To: davlopez4; +Cc: Paolo Carlini, Barrister David Lopez Esq, gcc

Well I'm certainly interested! I would like a venti, tripple-shot, cafe 
mocha, go easy on the syrup and one of those cute little birthday pops.  
Also, I want one of those drink carriers because my dog likes to play 
with them.

On 06/26/2013 01:15 PM, Paolo Carlini wrote:
 > Are you also a barman? I'm looking for a barman rather
 >
 > On 06/26/2013 12:40 PM, Barrister David Lopez Esq wrote:
 > > My name is Barrister David Lopez Esq of the MMS Law Firm in Madrid 
.I have a proposal for you, if you are interested,email me at  
davlopez4@aol.com
 > >
 > > Best regards.
 > > Barrister David
 > > davlopez4@aol.com


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

* Re: Proposal
  2013-06-26 17:41 Proposal Barrister David Lopez Esq
@ 2013-06-26 18:15 ` Paolo Carlini
  2013-06-26 18:40   ` Proposal Daniel Santos
  0 siblings, 1 reply; 45+ messages in thread
From: Paolo Carlini @ 2013-06-26 18:15 UTC (permalink / raw)
  To: davlopez4, Barrister David Lopez Esq, gcc



Are you also a barman? I'm looking for a barman rather

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

* Proposal
@ 2013-06-26 17:47 Barrister David Lopez Esq
  0 siblings, 0 replies; 45+ messages in thread
From: Barrister David Lopez Esq @ 2013-06-26 17:47 UTC (permalink / raw)
  To: gcc

My name is Barrister David Lopez Esq of the MMS Law Firm in Madrid .I have a proposal for you, if you are interested,email me at  davlopez4@aol.com 

Best regards.
Barrister David
davlopez4@aol.com



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

* Proposal
@ 2013-06-26 17:41 Barrister David Lopez Esq
  2013-06-26 18:15 ` Proposal Paolo Carlini
  0 siblings, 1 reply; 45+ messages in thread
From: Barrister David Lopez Esq @ 2013-06-26 17:41 UTC (permalink / raw)
  To: gcc

My name is Barrister David Lopez Esq of the MMS Law Firm in Madrid .I have a proposal for you, if you are interested,email me at  davlopez4@aol.com 

Best regards.
Barrister David
davlopez4@aol.com



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

* Proposal
@ 2012-09-03 18:35 Afeez Basit
  0 siblings, 0 replies; 45+ messages in thread
From: Afeez Basit @ 2012-09-03 18:35 UTC (permalink / raw)
  To: gcc

Good day,

I am Afeez Basit I represent the interest of my brother in-law who is a minister in the Syrian Government. As you probably know, there is a lot of crisis going on currently in Syria and my brother in-law is having problems with the ruling party and they are currently investigating his ministry. While he is sure that he has not done anything wrong, there is also every reason for him to secure to think ahead his family’s future in case the unexpected happens. He has asked me to help him find a reputable foreigner who can help him invest a substantial amount of money. I am contacting you with the hope that you can assist with investments in the market of your country. We will provide the funds. If you are interested in learning more about this opportunity, please kindly contact me back via email and I will give you more details. Hopefully, we can do some good business together.

Regards,

Afeez Basit.

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

* Proposal
@ 2012-09-03 15:16 Afeez Basit
  0 siblings, 0 replies; 45+ messages in thread
From: Afeez Basit @ 2012-09-03 15:16 UTC (permalink / raw)
  To: gcc

Good day,

I am Afeez Basit I represent the interest of my brother in-law who is a minister in the Syrian Government. As you probably know, there is a lot of crisis going on currently in Syria and my brother in-law is having problems with the ruling party and they are currently investigating his ministry. While he is sure that he has not done anything wrong, there is also every reason for him to secure to think ahead his family’s future in case the unexpected happens. He has asked me to help him find a reputable foreigner who can help him invest a substantial amount of money. I am contacting you with the hope that you can assist with investments in the market of your country. We will provide the funds. If you are interested in learning more about this opportunity, please kindly contact me back via email and I will give you more details. Hopefully, we can do some good business together.

Regards,

Afeez Basit.

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

* Re: Proposal
  2001-09-27  7:09       ` Proposal Frank Klemm
  2001-09-27 16:22         ` Proposal Zack Weinberg
  2001-09-27 16:36         ` Proposal Neil Booth
@ 2001-10-03  3:52         ` Fergus Henderson
  2 siblings, 0 replies; 45+ messages in thread
From: Fergus Henderson @ 2001-10-03  3:52 UTC (permalink / raw)
  To: Frank Klemm; +Cc: gcc

On 27-Sep-2001, Frank Klemm <pfk@fuchs.offl.uni-jena.de> wrote:
> '_' should be allowed in numbers. It is allowed between the digits of
> numbers in a C/C++ source _before_ preprocessing. It is not allowed between
> digits which are 'created' during the preprocessor phase.
> 
> It is nearly impossible to write a filter which recognizes such '_'
> and removes it. This is the reason for this rule. If gcc introduces a '_' in
> numbers, such a filter is a MUST.

I disagree that such a filter is necessary.
I think a filter which just handled the cases that don't involve
token concatenation would be quite sufficient.

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: < http://www.cs.mu.oz.au/~fjh >  |     -- the last words of T. S. Garp.

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

* Re: Proposal
  2001-09-29 15:45           ` Proposal Frank Klemm
@ 2001-09-30  9:35             ` Zack Weinberg
  0 siblings, 0 replies; 45+ messages in thread
From: Zack Weinberg @ 2001-09-30  9:35 UTC (permalink / raw)
  To: Frank Klemm; +Cc: gcc

On Sat, Sep 29, 2001 at 08:08:11PM +0200, Frank Klemm wrote:
> > 
> > Nonsense.  Your filter program can simply sit between the preprocessor
> > and the compiler.
> > 
> This do not work. Preprocessed files are not suitable for distribution.
> 
>     blafasel-KandR.tar.Z
>     blafasel-C89.tar.gz
>     blafasel-C99.tar.bz2
>     blafasel-C_99.tar.bz2
> 
> You write the source in C_99 and you also want to distribute the source as
> C99, so you can also compile the source with other binary only compilers.

You distribute the C_99 version of the code and include the filter
programs which translate it to C99/C89/K+R.  You wire them into your
Makefile according to what your configure script determines are the
features of the compiler being used.

zw

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

* Re: Proposal
  2001-09-29 15:45           ` Proposal Frank Klemm
@ 2001-09-29 17:22             ` Daniel Jacobowitz
  0 siblings, 0 replies; 45+ messages in thread
From: Daniel Jacobowitz @ 2001-09-29 17:22 UTC (permalink / raw)
  To: Frank Klemm; +Cc: Neil Booth, gcc

On Sat, Sep 29, 2001 at 07:55:53PM +0200, Frank Klemm wrote:
> On Fri, Sep 28, 2001 at 12:36:13AM +0100, Neil Booth wrote:
> > Frank Klemm wrote:-
> > 
> > > '_' should be allowed in numbers. It is allowed between the digits of
> > > numbers in a C/C++ source _before_ preprocessing. It is not allowed between
> > > digits which are 'created' during the preprocessor phase.
> > 
> > Why are you so keen to disallow it in created tokens? 
> >
> Write a filter which converts a C_99 source file to C99.
> The first with this restriction, the second without.
> 
> It must be pssoible to translate such source file with "old" compilers.

If you're that interested in portability, simply do not use this
construct!  That's the way the game is played.  Your restriction buys
nothing except complexity.

> > If a patch to implement '_' in numbers were submitted, I would require
> > that a preprocessing number be a pp number no matter how it is created;
> > I'm pretty sure Zack would agree with me.
> > 
> > > #define MY_MERGE_5(a,b,c,d,e)  a##b##c##d##e  
> > > #define MILLION                MY_MERGE_5 ( 1, _, 000, _, 000 )
> > > #define BILLION	               MY_MERGE_5 ( MILLION, _, 000, _, 000 )	// UK notation
> > 
> > BILLION won't expand to what you think.  As for UK notation, I'm
> > British and I can't think of the last time I've seen a billion have 12
> > zeroes.  In fact, I think the only time it occurs is when people are
> > comparing the claimed British and American forms :-)
> > 
> A billion has no zeros: 1.e+12

I think that what Neil meant is:
% units billion
        Definition: 1e9 = 1e+09


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer

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

* Re: Proposal
  2001-09-27 16:22         ` Proposal Zack Weinberg
@ 2001-09-29 15:45           ` Frank Klemm
  2001-09-30  9:35             ` Proposal Zack Weinberg
  0 siblings, 1 reply; 45+ messages in thread
From: Frank Klemm @ 2001-09-29 15:45 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

On Thu, Sep 27, 2001 at 04:22:09PM -0700, Zack Weinberg wrote:
> On Thu, Sep 27, 2001 at 04:07:55PM +0200, Frank Klemm wrote:
> > On Thu, Sep 27, 2001 at 05:17:40AM -0300, Alexandre Oliva wrote:
> > > On Sep 17, 2001, Frank Klemm <pfk@fuchs.offl.uni-jena.de> wrote:
> > > 
> > > > For instance try to convert 
> > > 
> > > >    #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )
> > > 
> > > If you're going down this road, I'd rather just do
> > > 
> > > #define MILLION MERGE3(1, 000, 000)
> > > 
> > > where
> > > 
> > > #define MERGE3(a,b,c) a##b##c
> > > 
> > Everyone misinterprets this example.
> > 
> > This is not an example to write 'grouped' numbers.
> > 
> > It is an example what must be forbidden to be able to write a filter program
> > which removes '_' from numbers.
> 
> Nonsense.  Your filter program can simply sit between the preprocessor
> and the compiler.
> 
This do not work. Preprocessed files are not suitable for distribution.

    blafasel-KandR.tar.Z
    blafasel-C89.tar.gz
    blafasel-C99.tar.bz2
    blafasel-C_99.tar.bz2

You write the source in C_99 and you also want to distribute the source as
C99, so you can also compile the source with other binary only compilers.
   
-- 
Frank Klemm

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

* Re: Proposal
  2001-09-27 16:36         ` Proposal Neil Booth
@ 2001-09-29 15:45           ` Frank Klemm
  2001-09-29 17:22             ` Proposal Daniel Jacobowitz
  0 siblings, 1 reply; 45+ messages in thread
From: Frank Klemm @ 2001-09-29 15:45 UTC (permalink / raw)
  To: Neil Booth; +Cc: gcc

On Fri, Sep 28, 2001 at 12:36:13AM +0100, Neil Booth wrote:
> Frank Klemm wrote:-
> 
> > '_' should be allowed in numbers. It is allowed between the digits of
> > numbers in a C/C++ source _before_ preprocessing. It is not allowed between
> > digits which are 'created' during the preprocessor phase.
> 
> Why are you so keen to disallow it in created tokens? 
>
Write a filter which converts a C_99 source file to C99.
The first with this restriction, the second without.

It must be pssoible to translate such source file with "old" compilers.


> If a patch to implement '_' in numbers were submitted, I would require
> that a preprocessing number be a pp number no matter how it is created;
> I'm pretty sure Zack would agree with me.
> 
> > #define MY_MERGE_5(a,b,c,d,e)  a##b##c##d##e  
> > #define MILLION                MY_MERGE_5 ( 1, _, 000, _, 000 )
> > #define BILLION	               MY_MERGE_5 ( MILLION, _, 000, _, 000 )	// UK notation
> 
> BILLION won't expand to what you think.  As for UK notation, I'm
> British and I can't think of the last time I've seen a billion have 12
> zeroes.  In fact, I think the only time it occurs is when people are
> comparing the claimed British and American forms :-)
> 
A billion has no zeros: 1.e+12

-- 
Frank Klemm

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

* Re: Proposal
  2001-09-27  7:09       ` Proposal Frank Klemm
  2001-09-27 16:22         ` Proposal Zack Weinberg
@ 2001-09-27 16:36         ` Neil Booth
  2001-09-29 15:45           ` Proposal Frank Klemm
  2001-10-03  3:52         ` Proposal Fergus Henderson
  2 siblings, 1 reply; 45+ messages in thread
From: Neil Booth @ 2001-09-27 16:36 UTC (permalink / raw)
  To: Frank Klemm; +Cc: gcc

Frank Klemm wrote:-

> '_' should be allowed in numbers. It is allowed between the digits of
> numbers in a C/C++ source _before_ preprocessing. It is not allowed between
> digits which are 'created' during the preprocessor phase.

Why are you so keen to disallow it in created tokens?  If a patch to
implement '_' in numbers were submitted, I would require that a
preprocessing number be a pp number no matter how it is created; I'm
pretty sure Zack would agree with me.

> #define MY_MERGE_5(a,b,c,d,e)  a##b##c##d##e  
> #define MILLION                MY_MERGE_5 ( 1, _, 000, _, 000 )
> #define BILLION	               MY_MERGE_5 ( MILLION, _, 000, _, 000 )	// UK notation

BILLION won't expand to what you think.  As for UK notation, I'm
British and I can't think of the last time I've seen a billion have 12
zeroes.  In fact, I think the only time it occurs is when people are
comparing the claimed British and American forms :-)

Neil.

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

* Re: Proposal
  2001-09-27  7:09       ` Proposal Frank Klemm
@ 2001-09-27 16:22         ` Zack Weinberg
  2001-09-29 15:45           ` Proposal Frank Klemm
  2001-09-27 16:36         ` Proposal Neil Booth
  2001-10-03  3:52         ` Proposal Fergus Henderson
  2 siblings, 1 reply; 45+ messages in thread
From: Zack Weinberg @ 2001-09-27 16:22 UTC (permalink / raw)
  To: Frank Klemm; +Cc: gcc

On Thu, Sep 27, 2001 at 04:07:55PM +0200, Frank Klemm wrote:
> On Thu, Sep 27, 2001 at 05:17:40AM -0300, Alexandre Oliva wrote:
> > On Sep 17, 2001, Frank Klemm <pfk@fuchs.offl.uni-jena.de> wrote:
> > 
> > > For instance try to convert 
> > 
> > >    #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )
> > 
> > If you're going down this road, I'd rather just do
> > 
> > #define MILLION MERGE3(1, 000, 000)
> > 
> > where
> > 
> > #define MERGE3(a,b,c) a##b##c
> > 
> Everyone misinterprets this example.
> 
> This is not an example to write 'grouped' numbers.
> 
> It is an example what must be forbidden to be able to write a filter program
> which removes '_' from numbers.

Nonsense.  Your filter program can simply sit between the preprocessor
and the compiler.

zw

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

* Re: Proposal
  2001-09-27  5:39     ` Proposal Alexandre Oliva
@ 2001-09-27  7:09       ` Frank Klemm
  2001-09-27 16:22         ` Proposal Zack Weinberg
                           ` (2 more replies)
  0 siblings, 3 replies; 45+ messages in thread
From: Frank Klemm @ 2001-09-27  7:09 UTC (permalink / raw)
  To: gcc

On Thu, Sep 27, 2001 at 05:17:40AM -0300, Alexandre Oliva wrote:
> On Sep 17, 2001, Frank Klemm <pfk@fuchs.offl.uni-jena.de> wrote:
> 
> > For instance try to convert 
> 
> >    #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )
> 
> If you're going down this road, I'd rather just do
> 
> #define MILLION MERGE3(1, 000, 000)
> 
> where
> 
> #define MERGE3(a,b,c) a##b##c
> 
Everyone misinterprets this example.

This is not an example to write 'grouped' numbers.

It is an example what must be forbidden to be able to write a filter program
which removes '_' from numbers.

'_' should be allowed in numbers. It is allowed between the digits of
numbers in a C/C++ source _before_ preprocessing. It is not allowed between
digits which are 'created' during the preprocessor phase.

It is nearly impossible to write a filter which recognizes such '_'
and removes it. This is the reason for this rule. If gcc introduces a '_' in
numbers, such a filter is a MUST.


Exercise: 
  Write a program which translates the following C_99 program to C99:

------------------------------------------------------------------------
#include <stdio.h>

#define MY_MERGE_5(a,b,c,d,e)  a##b##c##d##e  
#define MILLION                MY_MERGE_5 ( 1, _, 000, _, 000 )
#define BILLION	               MY_MERGE_5 ( MILLION, _, 000, _, 000 )	// UK notation
#define VAR		       MY_MERGE_5 ( a, _, b, _, c )
#define VAR2		       MY_MERGE_5 ( a, b, c, d, e )

int  
main ( void ) 
{
    int        abc   = MILLION;
    int        VAR   = MILLION;
    long long  x     = BILLION;
    int        VAR2  = MILLION;

    printf ("%d %d %lld %d %d\n", abc, VAR, x, VAR2, abcde );
    printf ("1000000 1000000 1000000000000 1000000 1000000\n" );
    return 0;
}
-----------------------------------------------------------------------

-- 
Frank Klemm

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

* Re: Proposal
  2001-09-18  9:48   ` Proposal Frank Klemm
  2001-09-18 11:06     ` Proposal Neil Booth
  2001-09-18 11:37     ` Proposal Kevin Handy
@ 2001-09-27  5:39     ` Alexandre Oliva
  2001-09-27  7:09       ` Proposal Frank Klemm
  2 siblings, 1 reply; 45+ messages in thread
From: Alexandre Oliva @ 2001-09-27  5:39 UTC (permalink / raw)
  To: Frank Klemm; +Cc: Neil Booth, gcc

On Sep 17, 2001, Frank Klemm <pfk@fuchs.offl.uni-jena.de> wrote:

> For instance try to convert 

>    #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )

If you're going down this road, I'd rather just do

#define MILLION MERGE3(1, 000, 000)

where

#define MERGE3(a,b,c) a##b##c

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

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

* Re: Proposal
  2001-09-20 11:17           ` Proposal Kai Henningsen
@ 2001-09-20 12:34             ` Russ Allbery
  0 siblings, 0 replies; 45+ messages in thread
From: Russ Allbery @ 2001-09-20 12:34 UTC (permalink / raw)
  To: gcc

Kai Henningsen <kaih@khms.westfalen.de> writes:
> rra@stanford.edu (Russ Allbery) wrote:

>> The hangup in this case is likely to be the click-through license on
>> that PDF file, which has some highly obnoxious clauses in it even above
>> and beyond not allowing redistribution.

> From the last discussion about said license, it essentially said "we
> won't be sued for that standard, no matter what you use it for", in
> lawyerese. I thought that was entirely reasonable.

It also says that if someone sues them, you pay their legal fees.  That's
the bit that's rather iffier.

I should clarify that I didn't consider it a sufficient drawback to avoid
buying it personally, but I can understand how other people would be leery
of it.

-- 
Russ Allbery (rra@stanford.edu)             < http://www.eyrie.org/~eagle/ >

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

* Re: Proposal
  2001-09-18 16:59         ` Proposal Russ Allbery
@ 2001-09-20 11:17           ` Kai Henningsen
  2001-09-20 12:34             ` Proposal Russ Allbery
  0 siblings, 1 reply; 45+ messages in thread
From: Kai Henningsen @ 2001-09-20 11:17 UTC (permalink / raw)
  To: gcc

rra@stanford.edu (Russ Allbery)  wrote on 18.09.01 in < yly9ncoxsp.fsf@windlord.stanford.edu >:

> Robert Lipe <robertlipe@usa.net> writes:
>
> > ANSI sells online copies for $18 USD.  It's a 1.4Mb PDF.  Looking again,
> > I see it at:
>
> >  http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI%2FISO%2FIEC+98
> >  99%2D1999
>
> > (Do we have any hangups about referencing "non-free" documents in
> > 'readings'?)
>
> The hangup in this case is likely to be the click-through license on that
> PDF file, which has some highly obnoxious clauses in it even above and
> beyond not allowing redistribution.

From the last discussion about said license, it essentially said "we won't  
be sued for that standard, no matter what you use it for", in lawyerese. I  
thought that was entirely reasonable.

MfG Kai

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

* Re: Proposal
  2001-09-18 12:23       ` Proposal Frank Klemm
  2001-09-18 22:37         ` Proposal Zack Weinberg
@ 2001-09-19 13:38         ` Joe Buck
  1 sibling, 0 replies; 45+ messages in thread
From: Joe Buck @ 2001-09-19 13:38 UTC (permalink / raw)
  To: Frank Klemm; +Cc: Zack Weinberg, gcc

Frank Klemm writes:

> Most programmers don't know the standard and are not interested in knowing
> the standard, because their (present) job is to solve a problem for one or
> two different systems, not for every theoretically possible system,
> and the standard supports nearly every stuff which has more than 4 pins ;-)

In my case, I have access to the standard, but its relevance to my
day-to-day work is limited, since I have to get my code past six different
implementations that all get the standard wrong.  So "is this correct ISO
C or C++" may be interesting, but "do all my targeted compilers get this
right, if not, how do I avoid a sea of #ifdefs" is more interesting.

> Programming portable, especially with C, takes much more time than
> programming for a special system, and the programmers don't have this time.

The standard does not tell one how to go about "programming portable",
because compiler vendors do not correctly implement the standard.  It
certainly helps, true, because compiler vendors have at least read the
thing and made some effort to comply, often with a long list of caveats
(especially in the case of C++).

The parts of the standard that most experienced programmers are not
familiar with tend also to be the parts of the standard that are
implemented incorrectly.

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

* Re: Proposal
@ 2001-09-19  2:44 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-19  2:44 UTC (permalink / raw)
  To: Richard.Earnshaw, tim; +Cc: gcc, neil, pfk, zack

<<As should (IMO) 0xffff_0000_ffff_ffffUL
>>

Yes, as in Ada, hex digits should definitely be included, indeed grouping
hex digits in groups of 4, as in the above example, is one of the most
useful applications of this lexical device.

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

* Re: Proposal
  2001-09-19  2:23             ` Proposal Tim Hollebeek
@ 2001-09-19  2:41               ` Richard Earnshaw
  0 siblings, 0 replies; 45+ messages in thread
From: Richard Earnshaw @ 2001-09-19  2:41 UTC (permalink / raw)
  To: tim; +Cc: Neil Booth, Zack Weinberg, Frank Klemm, gcc, Richard.Earnshaw

> 
> > Anything more complex is probably not worth it.
> 
> Long decimals benefit just as much as large integers
> do. "3.141_592_653_529" should be legal too.

As should (IMO) 0xffff_0000_ffff_ffffUL

Which means it has to be a little more general than "decimal digit"

R.


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

* Re: Proposal
@ 2001-09-19  2:34 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-19  2:34 UTC (permalink / raw)
  To: neil, tim; +Cc: gcc, pfk, zack

I always learned pi in groups of 5

3.14159_26535_89793 ... (and I still think I could remember 100 digits :-)

but yes, of course, your example is most relevant :-)

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

* Re: Proposal
  2001-09-19  0:02           ` Proposal Neil Booth
@ 2001-09-19  2:23             ` Tim Hollebeek
  2001-09-19  2:41               ` Proposal Richard Earnshaw
  0 siblings, 1 reply; 45+ messages in thread
From: Tim Hollebeek @ 2001-09-19  2:23 UTC (permalink / raw)
  To: Neil Booth; +Cc: Zack Weinberg, Frank Klemm, gcc

> Anything more complex is probably not worth it.

Long decimals benefit just as much as large integers
do. "3.141_592_653_529" should be legal too.

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

* Re: Proposal
  2001-09-18 22:20         ` Proposal Zack Weinberg
@ 2001-09-19  1:14           ` Joseph S. Myers
  0 siblings, 0 replies; 45+ messages in thread
From: Joseph S. Myers @ 2001-09-19  1:14 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: gcc

On Tue, 18 Sep 2001, Zack Weinberg wrote:

> I'm not sure of this; would they be useful to normal users of GCC?
> Standardization proposals tend to be written in standardese and
> therefore are not suitable as end-user documentation.

They're just as suitable as the standards themselves are - and the
standards themselves *ought* to be being used for reference by every
serious programmer in standardised languages.  (Though this doesn't remove
the use of existing tutorial material in the manual and of bodies of code
with idiomatic uses of the extensions for users to read and learn from;
nor do I claim that the optimal method for all users of *learning* C or
C++ is to read ISO 9899 or ISO 14882.)  Of course the proposals would
include the rationale for the changes as well as the actual textual
changes to the standard.

-- 
Joseph S. Myers
jsm28@cam.ac.uk

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

* Re: Proposal
@ 2001-09-19  0:06 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-19  0:06 UTC (permalink / raw)
  To: pfk, zack; +Cc: gcc

<<You should investigate the rules for numeric syntax in languages
which already have this notation, such as Ada and Perl.
>>

In Ada, underscores can only be used to separate digits, and the extension
is thus a simple one from a syntactic definition point of view. The actual
excerpt from the Ada grammar is as follows:

2   decimal_literal ::= numeral [.numeral] [exponent]

3   numeral ::= digit {[underline] digit}

4   exponent ::= E [+] numeral | E - numeral

I don't see any language or definition issue in introducing exactly this
same restricted form into C


       16777216_UL
       16777216U_L
       0._1234
       0x_1234
       12.34_e+56
       12.34e_+56

All these should be illegal if the above approach is followed, and I think
that is the right choice. The only legitimate use of the underscore is to
separate digits in a long sequence of digits.

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

* Re: Proposal
  2001-09-18 22:37         ` Proposal Zack Weinberg
@ 2001-09-19  0:02           ` Neil Booth
  2001-09-19  2:23             ` Proposal Tim Hollebeek
  0 siblings, 1 reply; 45+ messages in thread
From: Neil Booth @ 2001-09-19  0:02 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Frank Klemm, gcc

Zack Weinberg wrote:-

> Let's get back to what you originally proposed.  You want to be able
> to write 1000000 as 1_000_000 for legibility.  This would be easy to
> implement and I agree that it would be an improvement.  What you need
> to do is decide exactly what the extended syntax is supposed to be.
> For instance, are you allowed to write any of the following?
> 
> 	16777216_UL  [1]
> 	16777216U_L  [2]
> 	0._1234      [3]
> 	0x_1234      [4]
> 	12.34_e+56   [5]
> 	12.34e_+56   [6]
> 
> All but the last are legitimate "preprocessing numbers".  I can tell
> you right now that I'll be a lot more receptive to an extension that
> doesn't change the definition of a preprocessing number.

I don't think we want to accept anything that changes the pp-number
definition; I consider it set it stone.

I've labelled your examples above.  [6] is not a pp-number, so I'd
rule it out from the start.

For the rest, I see two reasonable things to say:

1) A pp-number with '_' in it is interpreted as if all '_' were stripped
   out initially.

2) We allow _ only in the integer part of decimals / hex / floats, but
   anywhere and anyhow in those parts.  Not valid in suffixes.  Interpreted
   as if the '_' were stripped out.  This would invalidate [2], [3] and [5].

Anything more complex is probably not worth it.  1) is appealling
merely because it is simple and unambiguous.

Neil.

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

* Re: Proposal
  2001-09-18 12:30 Proposal dewar
@ 2001-09-18 23:01 ` Zack Weinberg
  0 siblings, 0 replies; 45+ messages in thread
From: Zack Weinberg @ 2001-09-18 23:01 UTC (permalink / raw)
  To: dewar; +Cc: gcc

On Tue, Sep 18, 2001 at 03:30:14PM -0400, dewar@gnat.com wrote:
> <<Most programmers don't know the standard and are not interested in knowing
> the standard, because their (present) job is to solve a problem for one or
> two different systems, not for every theoretically possible system,
> and the standard supports nearly every stuff which has more than 4 pins ;-)
> >>
> 
> This very much varies by language. Nearly all Ada programmers *do* know
> the Ada standard, and use it as at least one of their reference sources.
> And it is probably not coincidental that the Ada ISO/ANSI standard *is*
> freely available.

... and it helps that the Ada standard is a fair bit less confusing
(on a casual read of the first few chapters) than the C standard is.

I would certainly like to see the C standard become more widely
disseminated and referred to.

zw

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

* Re: Proposal
  2001-09-18 12:23       ` Proposal Frank Klemm
@ 2001-09-18 22:37         ` Zack Weinberg
  2001-09-19  0:02           ` Proposal Neil Booth
  2001-09-19 13:38         ` Proposal Joe Buck
  1 sibling, 1 reply; 45+ messages in thread
From: Zack Weinberg @ 2001-09-18 22:37 UTC (permalink / raw)
  To: Frank Klemm; +Cc: gcc

On Tue, Sep 18, 2001 at 09:12:31PM +0200, Frank Klemm wrote:
> On Tue, Sep 18, 2001 at 10:20:00AM -0700, Zack Weinberg wrote:
> > 
> > I'd also point out that very few people have access to the
> > standard; yes, ANSI sells copies for not-totally-outrageous sums,
> > but many don't know that and the cost may still be too high.
>
> Most programmers don't know the standard and are not interested in
> knowing the standard, because their (present) job is to solve a
> problem for one or two different systems, not for every
> theoretically possible system, and the standard supports nearly
> every stuff which has more than 4 pins ;-)

We tend to see things differently from most programmers, since we are
responsible for supporting every feature of the compiler.  The
standard is the only thing that tells us what the compiler is supposed
to do, and we have enough trouble with its own ambiguities.  Every
extension adds ambiguities to that.

We are therefore concerned that extensions fit well with the standard,
The best way to ensure that is for the people who propose and
implement them to be deeply familiar with the standard.  As such, it
is a problem that the standard is not freely or even widely available.

Let's get back to what you originally proposed.  You want to be able
to write 1000000 as 1_000_000 for legibility.  This would be easy to
implement and I agree that it would be an improvement.  What you need
to do is decide exactly what the extended syntax is supposed to be.
For instance, are you allowed to write any of the following?

	16777216_UL
	16777216U_L
	0._1234
	0x_1234
	12.34_e+56
	12.34e_+56

All but the last are legitimate "preprocessing numbers".  I can tell
you right now that I'll be a lot more receptive to an extension that
doesn't change the definition of a preprocessing number.

You should investigate the rules for numeric syntax in languages
which already have this notation, such as Ada and Perl.

Once you've done an exhaustive analysis and decided what your syntax
is going to be, you should submit a patch which implements and
documents the new extension.  We will then consider it.

Oh, and file your copyright assignment paperwork now; the turnaround
time can be several months and we can't take any nontrivial patch of
yours until it's come back.

> I'm looking for some webspace for feature proposals, performance
> issues and warning issues.
> 
> And someone who translates my "pseudo English" into "real English".

Please feel free to submit patches to our website.  (You need not file
copyright paperwork to do this.)  You can check it out of CVS with

cvs -d :pserver:anoncvs@gcc.gnu.org:/cvs/gcc co wwwdocs

Read through the existing htdocs/projects directory first, please.

There are plenty of native English speakers on this list who will be
happy to help you with phrasing and so on.

zw

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

* Re: Proposal
  2001-09-18 11:14       ` Proposal Joseph S. Myers
@ 2001-09-18 22:20         ` Zack Weinberg
  2001-09-19  1:14           ` Proposal Joseph S. Myers
  0 siblings, 1 reply; 45+ messages in thread
From: Zack Weinberg @ 2001-09-18 22:20 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Neil Booth, pfk, gcc

On Tue, Sep 18, 2001 at 07:12:21PM +0100, Joseph S. Myers wrote:
> On Tue, 18 Sep 2001, Zack Weinberg wrote:
> 
> > I can tell you exactly what comp.std.c will say: Go away, implement
> > it, and get several years of experience with the extension, then come
> > back with a formal proposal.  The suggested extension (_ as a
> > separator in numbers) was actually proposed on comp.std.c just before
> > C99 was finalized, and they said just that.
> 
> Just before C99 was finalized wasn't an appropriate time for proposing new
> features; nor is now

Right - which is precisely why we *shouldn't* make proposers of
extensions run the gauntlet of comp.std.c or the WG14 reflector.

I would like to see us in a position to propose a set of useful
improvements to the standard in the next cycle, and that means
experimenting - both with our existing extensions and with new
ones.

I'm glad to hear the UK National Body is working on the existing
issues with the C standard, but that really doesn't affect the
original poster's proposal, which is about as independent of the
existing problems as you can get.  Which isn't to say that it is
perfect - I have concerns, though I like the idea in principle.
(see other message)

> > We have also been around this particular wheel with other extensions.
> > Does anyone remember __norestrict?  Your recipe is equivalent in
> > practice to "we will add no (more) extensions, ever."  Which is a
> > legitimate position to take, but only by coming out and saying so.  It
> > is unfair to run people through a lengthy bureaucratic procedure that
> > appears to offer the possibility of adding an extension, but will
> > always result in the extension being rejected.
> 
> The presumption must be against extensions because of the bad history of
> problems caused by extensions that are poorly defined or later cause
> problems in their interaction with new language features.

Certainly the presumption is against them, and in fact I think a
position of "no additional extensions at all" is extreme but
reasonable.  What I object to is your proposed procedure, which
_appears_ to be open to new extensions, but in practice is closed, and
will subject the proposers of extensions to a great deal of wasted
effort.  Again, remember __norestrict?

> > I'd also point out that very few people have access to the standard;
> > yes, ANSI sells copies for not-totally-outrageous sums, but many don't
> > know that and the cost may still be too high.
> 
> There is work in progress towards getting it published as a normal book
> (officially, not with value-subtracting annotations by Schildt) by a
> normal publisher whose books appear in bookshops.  (I don't have any more
> information about these plans.)

Oh good.

> > For all extensions, present or proposed, we either write up a formal
> > proposal to the standard committee, or we deprecate the extension.
> > The proposals are stored on the website.  Should we ever be in the
> 
> The proposals should be in the manual proper.

I'm not sure of this; would they be useful to normal users of GCC?
Standardization proposals tend to be written in standardese and
therefore are not suitable as end-user documentation.

Keep 'em in the tree, sure.

...
> (so that ISO have to negotiate with the FSF alone about the
> inclusion of such text in the standard, and this can be used as
> leverage to try to free the standard).

I don't think we should do that, it is likely to be counterproductive.
(I.e. I suspect the response would be to reject the proposals rather
than deal with the legal issues.)  Efforts to make the standard freely
distributable are laudable but should happen independently.

zw

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

* Re: Proposal
  2001-09-18 15:35       ` Proposal Robert Lipe
@ 2001-09-18 16:59         ` Russ Allbery
  2001-09-20 11:17           ` Proposal Kai Henningsen
  0 siblings, 1 reply; 45+ messages in thread
From: Russ Allbery @ 2001-09-18 16:59 UTC (permalink / raw)
  To: gcc

Robert Lipe <robertlipe@usa.net> writes:

> ANSI sells online copies for $18 USD.  It's a 1.4Mb PDF.  Looking again,
> I see it at:

>  http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI%2FISO%2FIEC+9899%2D1999

> (Do we have any hangups about referencing "non-free" documents in
> 'readings'?)

The hangup in this case is likely to be the click-through license on that
PDF file, which has some highly obnoxious clauses in it even above and
beyond not allowing redistribution.

-- 
Russ Allbery (rra@stanford.edu)             < http://www.eyrie.org/~eagle/ >

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

* Re: Proposal
  2001-09-18 15:48       ` Proposal Neil Booth
@ 2001-09-18 15:55         ` Toon Moene
  0 siblings, 0 replies; 45+ messages in thread
From: Toon Moene @ 2001-09-18 15:55 UTC (permalink / raw)
  To: Neil Booth; +Cc: Kevin Handy, Frank Klemm, gcc

Neil Booth wrote:

> Kevin Handy wrote:-

> > Another option for this that I'd prefer would be to write
> >
> > #define MY_MERGE_3(a,b,c) (a*1000000 + b*1000 + c)
> > #define MILLION   MY_MERGE_3(1,000,000)

> Careful, those are octal numbers 8-)

How about using Fortran ?

      PRINT*, 1 000 000
      END

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)

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

* Re: Proposal
  2001-09-18 11:37     ` Proposal Kevin Handy
@ 2001-09-18 15:48       ` Neil Booth
  2001-09-18 15:55         ` Proposal Toon Moene
  0 siblings, 1 reply; 45+ messages in thread
From: Neil Booth @ 2001-09-18 15:48 UTC (permalink / raw)
  To: Kevin Handy; +Cc: Frank Klemm, gcc

Kevin Handy wrote:-

> Another option for this that I'd prefer would be to write
> 
> #define MY_MERGE_3(a,b,c) (a*1000000 + b*1000 + c)
> #define MILLION   MY_MERGE_3(1,000,000)
> 
> which doesn't need the extension, and you get to use comma's as the
> separator which is what people normally expect. This example is
> somewhat stupid, in that the million (1000000) constant is also
> the MY_MERGE_3 definition, but you still get the idea.

Careful, those are octal numbers 8-)

Neil.

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

* Re: Proposal
  2001-09-18 10:21     ` Proposal Zack Weinberg
  2001-09-18 11:14       ` Proposal Joseph S. Myers
  2001-09-18 12:23       ` Proposal Frank Klemm
@ 2001-09-18 15:35       ` Robert Lipe
  2001-09-18 16:59         ` Proposal Russ Allbery
  2 siblings, 1 reply; 45+ messages in thread
From: Robert Lipe @ 2001-09-18 15:35 UTC (permalink / raw)
  To: gcc

Zack Weinberg wrote:

> I'd also point out that very few people have access to the standard;
> yes, ANSI sells copies for not-totally-outrageous sums, but many don't
> know that and the cost may still be too high.

ANSI sells online copies for $18 USD.  It's a 1.4Mb PDF.   Looking again,
I see it at:

 http://webstore.ansi.org/ansidocstore/product.asp?sku=ANSI%2FISO%2FIEC+9899%2D1999

(Do we have any hangups about referencing "non-free" documents in 'readings'?)


That said, I'm on the side that's very much NOT in favor of introducing 
more incompatible language extensions.

RJL

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

* Re: Proposal
@ 2001-09-18 12:30 dewar
  2001-09-18 23:01 ` Proposal Zack Weinberg
  0 siblings, 1 reply; 45+ messages in thread
From: dewar @ 2001-09-18 12:30 UTC (permalink / raw)
  To: gcc, pfk, zack

<<Most programmers don't know the standard and are not interested in knowing
the standard, because their (present) job is to solve a problem for one or
two different systems, not for every theoretically possible system,
and the standard supports nearly every stuff which has more than 4 pins ;-)
>>

This very much varies by language. Nearly all Ada programmers *do* know
the Ada standard, and use it as at least one of their reference sources.
And it is probably not coincidental that the Ada ISO/ANSI standard *is*
freely available.

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

* Re: Proposal
  2001-09-18 10:21     ` Proposal Zack Weinberg
  2001-09-18 11:14       ` Proposal Joseph S. Myers
@ 2001-09-18 12:23       ` Frank Klemm
  2001-09-18 22:37         ` Proposal Zack Weinberg
  2001-09-19 13:38         ` Proposal Joe Buck
  2001-09-18 15:35       ` Proposal Robert Lipe
  2 siblings, 2 replies; 45+ messages in thread
From: Frank Klemm @ 2001-09-18 12:23 UTC (permalink / raw)
  To: Zack Weinberg, gcc

On Tue, Sep 18, 2001 at 10:20:00AM -0700, Zack Weinberg wrote:
> 
> I'd also point out that very few people have access to the standard;
> yes, ANSI sells copies for not-totally-outrageous sums, but many don't
> know that and the cost may still be too high.
> 
Most programmers don't know the standard and are not interested in knowing
the standard, because their (present) job is to solve a problem for one or
two different systems, not for every theoretically possible system,
and the standard supports nearly every stuff which has more than 4 pins ;-)

Programming portable, especially with C, takes much more time than
programming for a special system, and the programmers don't have this time.
And some kins of problems are not supported by C, so you must write it in a
sub assembler language way.


> Counterproposal: Require people who propose extensions to document
> their semantics in detail, to the point where a formal proposal
> _could_ be made to the standard committee, but don't make them get
> beaten up by comp.std.c.  Debate the extension here and in the user
> community.  If there's agreement that it would be useful, it would not
> clash with present or future standard behavior, and it would not cause
> unfortunate consequences down the road, then we implement it.
> 
> For all extensions, present or proposed, we either write up a formal
> proposal to the standard committee, or we deprecate the extension.
> The proposals are stored on the website.  Should we ever be in the
> position of having representation on the committee (which I believe we
> currently do not) we can then submit them.
> 
I'm looking for some webspace for feature proposals, performance issues and warning
issues. 

And someone who translates my "pseudo English" into "real English".

  - 1 Mbyte for HTML
  - 5 Mbyte for tables
  - a link to this page

-- 
Frank Klemm

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

* Re: Proposal
  2001-09-18  9:48   ` Proposal Frank Klemm
  2001-09-18 11:06     ` Proposal Neil Booth
@ 2001-09-18 11:37     ` Kevin Handy
  2001-09-18 15:48       ` Proposal Neil Booth
  2001-09-27  5:39     ` Proposal Alexandre Oliva
  2 siblings, 1 reply; 45+ messages in thread
From: Kevin Handy @ 2001-09-18 11:37 UTC (permalink / raw)
  To: Frank Klemm; +Cc: Neil Booth, gcc

Frank Klemm wrote:
> 
> On Mon, Sep 17, 2001 at 11:59:28PM +0100, Neil Booth wrote:
> >
> > > It is not allowed to compose numbers with '_' inside of macros.
> > >
> > >   #define MILLION   _MERGE5 ( 1, _, 000, _, 000 )
> > >

[snip]

> For instance you have a program which uses _ in numbers.
> But not all compilers will will support this in the beginning.
> 
> It should be possible to write a program which removes these _ inside of
> numbers to allow to compile such source files with other compilers.
> 
> Without this rule it is impossible to write such a program without
> preprocessing the source file. And preprocessed files are no source files
> anymore.
> 
> To prevent this it is forbidden to use this feature in conjunction with
> token concatenation. At least as long as this is not an ISO standard.
> 
> For instance try to convert
> 
>    #define MILLION      MY_MERGE_5 ( 1, _, 000, _, 000 )

If you are using the underscore to make numbers more readable, then
using a macro like this doesn't seem to me to be a step in the right
direction. This looks (to me) to be harder to understand than a
simple '1000000' would be.

Another option for this that I'd prefer would be to write

#define MY_MERGE_3(a,b,c) (a*1000000 + b*1000 + c)
#define MILLION   MY_MERGE_3(1,000,000)

which doesn't need the extension, and you get to use comma's as the
separator which is what people normally expect. This example is
somewhat stupid, in that the million (1000000) constant is also
the MY_MERGE_3 definition, but you still get the idea.

> to the old representation. Note that MY_MERGE_5 is a self defined macro.

Someone could write a "preprocessor" in C (which you should have a
compiler for since you are trying to compile C code) that would
filter out the underscores in numbers. Then you could distribute
it along with your code for those running the wrong C compiler.
Not the greatest solution, but I'd think it would be better to
either use the extension or not.

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

* Re: Proposal
  2001-09-18 10:21     ` Proposal Zack Weinberg
@ 2001-09-18 11:14       ` Joseph S. Myers
  2001-09-18 22:20         ` Proposal Zack Weinberg
  2001-09-18 12:23       ` Proposal Frank Klemm
  2001-09-18 15:35       ` Proposal Robert Lipe
  2 siblings, 1 reply; 45+ messages in thread
From: Joseph S. Myers @ 2001-09-18 11:14 UTC (permalink / raw)
  To: Zack Weinberg; +Cc: Neil Booth, pfk, gcc

On Tue, 18 Sep 2001, Zack Weinberg wrote:

> I can tell you exactly what comp.std.c will say: Go away, implement
> it, and get several years of experience with the extension, then come
> back with a formal proposal.  The suggested extension (_ as a
> separator in numbers) was actually proposed on comp.std.c just before
> C99 was finalized, and they said just that.

Just before C99 was finalized wasn't an appropriate time for proposing new
features; nor is now (too soon until at least the standard is more widely
implemented; even then it may be some time before consideration of major
new features is appropriate (the UK National Body has agreed a position
(written by Nick Maclaren) that destabilising changes should be avoided
until there is industry consensus on the interpretation of C99 (readers of
comp.std.c will be familiar with his views of the problems in various
areas of C)), though at least this extension is comparatively harmless in
terms of interactions with others); when the time comes for C0X it should
be better publicised and more attention should be paid to comp.std.c (the
UK National Body has recently submitted 33 Defect Reports to WG14 (to add
to the 36 already registered and present on the WG14 web site), most of
them originating in problems reported to or discussed on comp.std.c).

> We have also been around this particular wheel with other extensions.
> Does anyone remember __norestrict?  Your recipe is equivalent in
> practice to "we will add no (more) extensions, ever."  Which is a
> legitimate position to take, but only by coming out and saying so.  It
> is unfair to run people through a lengthy bureaucratic procedure that
> appears to offer the possibility of adding an extension, but will
> always result in the extension being rejected.

The presumption must be against extensions because of the bad history of
problems caused by extensions that are poorly defined or later cause
problems in their interaction with new language features.  I included the
qualifications about "something that couldn't reasonably be done before"
and "might be appropriate for a future version of the standard" since
plenty of extensions are firmly within what is undefined in the standards,
e.g. asm, and others may reach the barrier of "couldn't reasonably be done
before" to justify them against the risk of future problems.  Another
qualification would be that new instances of existing extensions aren't
problematic (e.g. new built-in functions, new attributes).

> I'd also point out that very few people have access to the standard;
> yes, ANSI sells copies for not-totally-outrageous sums, but many don't
> know that and the cost may still be too high.

There is work in progress towards getting it published as a normal book
(officially, not with value-subtracting annotations by Schildt) by a
normal publisher whose books appear in bookshops.  (I don't have any more
information about these plans.)

> For all extensions, present or proposed, we either write up a formal
> proposal to the standard committee, or we deprecate the extension.
> The proposals are stored on the website.  Should we ever be in the

The proposals should be in the manual proper.  We should sort out the
manual assignment situation
(<URL: http://gcc.gnu.org/ml/gcc/2000-11/msg00753.html > and
<URL: http://gcc.gnu.org/ml/gcc/2000-11/msg00872.html >), and preferably get
a special assignment for such proposals that doesn't include the licence
grantback of the normal assignments (so that ISO have to negotiate with
the FSF alone about the inclusion of such text in the standard, and this
can be used as leverage to try to free the standard).

-- 
Joseph S. Myers
jsm28@cam.ac.uk

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

* Re: Proposal
  2001-09-18  9:48   ` Proposal Frank Klemm
@ 2001-09-18 11:06     ` Neil Booth
  2001-09-18 11:37     ` Proposal Kevin Handy
  2001-09-27  5:39     ` Proposal Alexandre Oliva
  2 siblings, 0 replies; 45+ messages in thread
From: Neil Booth @ 2001-09-18 11:06 UTC (permalink / raw)
  To: Frank Klemm; +Cc: gcc

Frank Klemm wrote:-

> For instance you have a program which uses _ in numbers. 
> But not all compilers will will support this in the beginning.

Sure.

> It should be possible to write a program which removes these _ inside of
> numbers to allow to compile such source files with other compilers.

If the _'s aren't already in your source code, I don't see much point
putting them there with macros.  Wasn't the whole idea legibility?

> Without this rule it is impossible to write such a program without
> preprocessing the source file. And preprocessed files are no source files
> anymore.

Well, you might be able to filter it through sed or something, with a
little difficulty.

> To prevent this it is forbidden to use this feature in conjunction with
> token concatenation. At least as long as this is not an ISO standard.
> 
> For instance try to convert 
> 
>    #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )
> 
> to the old representation. Note that MY_MERGE_5 is a self defined macro.

I don't know what you mean by a self-defined macro.  I don't
understand why you're using macros (see comment above).  I'm not even
sure what the definition of MY_MERGE_5 is, though I might guess.

Anyway, if you insist on macros, you could get what you want through
an extra indirection, and an extra macro

#if COMPILER_UNDERSTANDS_EXTENDED_NUMBERS
#define UNDERSCORE _
#else
#define UNDERSCORE
#endif

#define MY_MERGE_5_INDIRECT (a, b, c, d, e) MY_MERGE_5 (a, b, c, d, e)
#define MILLION	MY_MERGE_5_INDIRECT (1, UNDERSCORE, 000, UNDERSCORE, 000)

But I really can't see the point here.

Neil.

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

* Re: Proposal
  2001-09-18  2:30   ` Proposal Joseph S. Myers
@ 2001-09-18 10:21     ` Zack Weinberg
  2001-09-18 11:14       ` Proposal Joseph S. Myers
                         ` (2 more replies)
  0 siblings, 3 replies; 45+ messages in thread
From: Zack Weinberg @ 2001-09-18 10:21 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: Neil Booth, pfk, gcc

On Tue, Sep 18, 2001 at 10:28:50AM +0100, Joseph S. Myers wrote:
> On Mon, 17 Sep 2001, Neil Booth wrote:
> 
> > This is possibly a good idea.  It's a trivial patch to implement it
> > (c-lex.c I think, unless Zack finally applies his number patch); a
> > comment even exists in the code mentioning that it might be a future
> > extension.
> 
> However, we shouldn't add it to GCC yet.  Since this feature would not
> actually allow you to do something that couldn't reasonably be done before
> or make it substantially simpler to do so, and since it might be
> appropriate for a future version of the standard, a more appropriate
> procedure would be:
[snip]

I can tell you exactly what comp.std.c will say: Go away, implement
it, and get several years of experience with the extension, then come
back with a formal proposal.  The suggested extension (_ as a
separator in numbers) was actually proposed on comp.std.c just before
C99 was finalized, and they said just that.

We have also been around this particular wheel with other extensions.
Does anyone remember __norestrict?  Your recipe is equivalent in
practice to "we will add no (more) extensions, ever."  Which is a
legitimate position to take, but only by coming out and saying so.  It
is unfair to run people through a lengthy bureaucratic procedure that
appears to offer the possibility of adding an extension, but will
always result in the extension being rejected.

I'd also point out that very few people have access to the standard;
yes, ANSI sells copies for not-totally-outrageous sums, but many don't
know that and the cost may still be too high.

Counterproposal: Require people who propose extensions to document
their semantics in detail, to the point where a formal proposal
_could_ be made to the standard committee, but don't make them get
beaten up by comp.std.c.  Debate the extension here and in the user
community.  If there's agreement that it would be useful, it would not
clash with present or future standard behavior, and it would not cause
unfortunate consequences down the road, then we implement it.

For all extensions, present or proposed, we either write up a formal
proposal to the standard committee, or we deprecate the extension.
The proposals are stored on the website.  Should we ever be in the
position of having representation on the committee (which I believe we
currently do not) we can then submit them.

zw

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

* Re: Proposal
  2001-09-17 16:00 ` Proposal Neil Booth
  2001-09-18  2:30   ` Proposal Joseph S. Myers
@ 2001-09-18  9:48   ` Frank Klemm
  2001-09-18 11:06     ` Proposal Neil Booth
                       ` (2 more replies)
  1 sibling, 3 replies; 45+ messages in thread
From: Frank Klemm @ 2001-09-18  9:48 UTC (permalink / raw)
  To: Neil Booth, gcc

On Mon, Sep 17, 2001 at 11:59:28PM +0100, Neil Booth wrote:
> 
> > It is not allowed to compose numbers with '_' inside of macros.
> > 
> >   #define MILLION	_MERGE5 ( 1, _, 000, _, 000 )
> > 
> > This allows easily to write a filter to generate C89 or C99 files.
> 
> I don't understand quite what you're saying here.  If you're saying
> dissallow concatenation with ## then I would strenuously object, since
> 
> 1) disallowing it seems gratuitous,
> 2) it's specifically allowed by the standard, and
> 3) it would be introducing yet more special cases to the preprocessor,
>    which already has too many of those for my liking.
> 
For instance you have a program which uses _ in numbers. 
But not all compilers will will support this in the beginning.

It should be possible to write a program which removes these _ inside of
numbers to allow to compile such source files with other compilers.

Without this rule it is impossible to write such a program without
preprocessing the source file. And preprocessed files are no source files
anymore.

To prevent this it is forbidden to use this feature in conjunction with
token concatenation. At least as long as this is not an ISO standard.

For instance try to convert 

   #define MILLION	MY_MERGE_5 ( 1, _, 000, _, 000 )

to the old representation. Note that MY_MERGE_5 is a self defined macro.

-- 
Frank Klemm

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

* Re: Proposal
@ 2001-09-18  9:32 dewar
  0 siblings, 0 replies; 45+ messages in thread
From: dewar @ 2001-09-18  9:32 UTC (permalink / raw)
  To: gcc, trt

<<I'm puzzled by the argument against _ as separator in numbers,
that 1000000000000 can be written 1000 * 1000 * 1000 * 1000.
>>

By the way, speaking from an Ada perspective, once you get used to using
_ as a separator in numbers, you cannot imagine how languages without
such a feature are usable :-)

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

* Re: Proposal
  2001-09-17 16:00 ` Proposal Neil Booth
@ 2001-09-18  2:30   ` Joseph S. Myers
  2001-09-18 10:21     ` Proposal Zack Weinberg
  2001-09-18  9:48   ` Proposal Frank Klemm
  1 sibling, 1 reply; 45+ messages in thread
From: Joseph S. Myers @ 2001-09-18  2:30 UTC (permalink / raw)
  To: Neil Booth; +Cc: pfk, gcc

On Mon, 17 Sep 2001, Neil Booth wrote:

> This is possibly a good idea.  It's a trivial patch to implement it
> (c-lex.c I think, unless Zack finally applies his number patch); a
> comment even exists in the code mentioning that it might be a future
> extension.

However, we shouldn't add it to GCC yet.  Since this feature would not
actually allow you to do something that couldn't reasonably be done before
or make it substantially simpler to do so, and since it might be
appropriate for a future version of the standard, a more appropriate
procedure would be:

* Create a patch for GCC, and the exact proposed changes to the text of
C99.  (The patch is desirable here to show implementation experience.)

* Iterate with comp.std.c about the exact semantics and the desirability
of the feature.

* In due course, when the time comes for adding new language features to
the C standard (so not for a few years yet), propose it via your National
Body for inclusion in C0X.

* Once it is in a C0X draft, then addition to GCC as part of tracking C0X
drafts (with a strong warning that any features added as part of C0X
tracking may be removed or changed without notice to keep up with changing
drafts) would be appropriate.

History shows that extensions tend to cause problems, so we should be wary
of adding it until it is in a C0X draft.

-- 
Joseph S. Myers
jsm28@cam.ac.uk

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

* Re: Proposal
  2001-09-15 11:45 Proposal Frank Klemm
  2001-09-15 12:15 ` Proposal Gerald Pfeifer
@ 2001-09-17 16:00 ` Neil Booth
  2001-09-18  2:30   ` Proposal Joseph S. Myers
  2001-09-18  9:48   ` Proposal Frank Klemm
  1 sibling, 2 replies; 45+ messages in thread
From: Neil Booth @ 2001-09-17 16:00 UTC (permalink / raw)
  To: pfk; +Cc: gcc

Frank Klemm wrote:-

> Ada 83 and Ada 95 allows '_' in numbers to separate groups of numbers:
> 
>     0xFFFF_FFFF_FFFF_FFFC
>     1_000_000_000_000
>     0x0FFF_FFFF_FFFF_FFFC
>     10_000_000_000_000
>     3.14159_26535_8979
>     12_768_487.0
>     
> The '_' is allowed at every position between digits, but it is recommend to use 
> it in the way above.

This is possibly a good idea.  It's a trivial patch to implement it
(c-lex.c I think, unless Zack finally applies his number patch); a
comment even exists in the code mentioning that it might be a future
extension.

> It is not allowed to compose numbers with '_' inside of macros.
> 
>   #define MILLION	_MERGE5 ( 1, _, 000, _, 000 )
> 
> This allows easily to write a filter to generate C89 or C99 files.

I don't understand quite what you're saying here.  If you're saying
dissallow concatenation with ## then I would strenuously object, since

1) disallowing it seems gratuitous,
2) it's specifically allowed by the standard, and
3) it would be introducing yet more special cases to the preprocessor,
   which already has too many of those for my liking.

Neil.

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

* Re: Proposal
  2001-09-15 11:45 Proposal Frank Klemm
@ 2001-09-15 12:15 ` Gerald Pfeifer
  2001-09-17 16:00 ` Proposal Neil Booth
  1 sibling, 0 replies; 45+ messages in thread
From: Gerald Pfeifer @ 2001-09-15 12:15 UTC (permalink / raw)
  To: pfk; +Cc: gcc, Marc Lehmann

On Sat, 15 Sep 2001, Frank Klemm wrote:
>   - libc related issues

libc related issue are (far) beyond the scope of GCC, as far as I can
see.

> Performance test suite
>
>   - list of small *.inc files containing a small piece of code  4)
>   - a body function which does all the rest
>   - a table for the Duron/Athlon family, for the PII/PIII/Celeron family and
>     one for the P4 family
>   - a table for -O, -O2 and for -O3
>   - task is to show improvements and deterioration in the compilers code

That's definitely worthwhile. Marc already started working on something
like this some time ago, it would be nice to unite both efforts.

Though, this should not be limited to ia32 processors, as per your
suggestion.

Geraldy
-- 
Gerald "Jerry" pfeifer@dbai.tuwien.ac.at http://www.dbai.tuwien.ac.at/~pfeifer/

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

* Proposal
@ 2001-09-15 11:45 Frank Klemm
  2001-09-15 12:15 ` Proposal Gerald Pfeifer
  2001-09-17 16:00 ` Proposal Neil Booth
  0 siblings, 2 replies; 45+ messages in thread
From: Frank Klemm @ 2001-09-15 11:45 UTC (permalink / raw)
  To: gcc

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6778 bytes --]

I propose a websites with the following contents:

  - gcc language extentions
  - possible performance enhancements 2)
  - warnings of the compiler  3)
  - libc related issues

  - gcc language extentions (future)  1)
  - possible performance enhancements (future)
  - warnings of the compiler (future)  
  - libc related issues (future)

  - gcc language extentions (decline)
  - possible performance enhancements (decline)
  - warnings of the compiler (decline)
  - libc related issues (decline)

  
Every proposal is discussed in the mailing list and is classified into:

  - should be done in the next time
  - future improvement, useful, but too difficult to implement in the next time
  - decline, not so useful, too many problems, too difficult to implement
  
  - gcc language extentions: Extention of the language C or C++
  - where are performance improvements possible
  - additional or superfluous warnings (or errors)
  - libc related issues, missing library function, problems,
    bugs and flaws


Performance test suite

  - list of small *.inc files containing a small piece of code  4)
  - a body function which does all the rest
  - a table for the Duron/Athlon family, for the PII/PIII/Celeron family and
    one for the P4 family
  - a table for -O, -O2 and for -O3
  - task is to show improvements and deterioration in the compilers code


Test#  Description                    operations/µs
                                2.95.2  3.00    3.01    3.02
-------------------------------------------------------------
 137  round test (int)floor()   11.5    11.9    11.8    191
 138  foobar                    91      75      75      92








1) ******************************************************************************

Separator for long number
~~~~~~~~~~~~~~~~~~~~~~~~~

The bigger the number the more difficult is it to decipher large numbers:

    0xFFFFFFFFFFFFFFFC
    1000000000000
    0x0FFFFFFFFFFFFFFC
    10000000000000
    3.14159265358979
    12768487.0

Ada 83 and Ada 95 allows '_' in numbers to separate groups of numbers:

    0xFFFF_FFFF_FFFF_FFFC
    1_000_000_000_000
    0x0FFF_FFFF_FFFF_FFFC
    10_000_000_000_000
    3.14159_26535_8979
    12_768_487.0
    
The '_' is allowed at every position between digits, but it is recommend to use 
it in the way above.

  integral hexadecimal numbers:		4 digits
  decimal integral part of numbers:	3 digits
  fractional part of numbers:		5 digits

May be we should introduce this is C too.

It is not allowed to compose numbers with '_' inside of macros.

  #define MILLION	_MERGE5 ( 1, _, 000, _, 000 )

This allows easily to write a filter to generate C89 or C99 files.
    

Problems
~~~~~~~~

The are no problems with foreward compatibilty, syntax always generates a syntax error on standard C99 compilers.
Programs are not backward compatible at all.

gcc should contain a filter to convert files with '_' inside of numbers into
C89 or C99 files.

    gcc -_ program.c > filtered/program.c


Pros
~~~~

It makes C and C++ programs easier to read
It is easier to find errors.


Cons
~~~~

Bad backward compatibility.
There are other writing possible:

  1000000000000      = 1_000_000_000_000     = 1000 * 1000 * 1000 * 1000
  0xFFFFFFFFFFFFFF00 = 0xFFFF_FFFF_FFFF_FF00 = ~0x100
  
But it is easy to introduce other bugs with these writings




2 ****************************************************************************

Command line ----------------------------------------

gcc302 -O3 -fomit-frame-pointer

C code ----------------------------------------------

unsigned long long x;

void
main ( void )
{
    x >>= 32;
    return 0;
}

Assembler code ---------------------------------------

main:	pushl	%ebp		<------
	movl	%esp, %ebp	<------
	subl	$8, %esp	<------
	movl	x+4, %eax
	xorl	%edx, %edx
	andl	$-16, %esp	<------
	movl	%edx, x+4
	movl	%eax, x
	movl	%ebp, %esp	<------
	xorl	%eax, %eax
	popl	%ebp		<------
	ret


Suggested optimized Assembler code: ------------------------------

// -O2
main:	movl	x+4, %eax
	xorl	%edx, %edx
	movl	%eax, x
	movl	%edx, x+4
	xorl	%eax, %eax
	ret
	
// -Os	
main:	movl	$x, %ecx
	xorl	%edx, %edx
	movl	4(%ecx), %eax
	movl	%edx, 4(%ecx)
	movl	%eax,  (%ecx)
	xorl	%eax, %eax
	ret

// -Oss
main:	movl	$x+4, %ecx
	xorl	%eax, %eax
	movl	(%ecx), %edx
	movl	%eax, (%ecx)
	movl	%edx, -4(%ecx)
	ret

Current version: 33 byte
proposed -O2:    21 byte
proposed -Os:    18 byte
proposed -Oss:   15 byte


Remarks ----------------------------------------------

Stack alignment of gcc 3.02 is really a nasty thing.
It blows up code, it slows down code. It is really a pain.

Before doing alignment on stack there should be clarified:

  - who is responsable for aligning (caller / called)
  - when it have a chance to speed up code (you need at least 64 bit items)
  - what other conditions are needed to speed up code
    (manipulating %esp decreases speed of push/pop/mov)


Proposal ------------------------------------------------

  - A caller should never align the stack
  - A function aligns the stack if there are arrays of 64 bit local
    variables on the stack
  - If there are many 64 bit local variables on stack the function may align
    the stack
  - functions arguments can be copied to such a local place if the variable
    is often used and not copied to a FPU register.

3 ***************************************************************


Problem
~~~~~~~

Using of operator <=, >= or != although only one of the two partial conditions
is possible:

   unsigned int  x;
   if ( x <= 0 ) {
       ...
   }

   unsigned char  c;
   if ( c != 255 ) {
       ...
   }

This is often a hint that the code is wrong.
It should be possible to genarte a warning for such code.


4 *******************************************************************

/*
 *  Rounding floats to integers, always rounding to -inf.
 */

/* Argument is the ca. execution time on a 1 GHz computer in milliseconds */

float  test0137_float [1000];
int    test0137_int   [1000];

struct result
test0137_run ( unsigned int  ms )
{
    struct result  ret;
    unsigned int   i;
    unsigned int   j;
    unsigned int   k;

    for ( k = 0; k < ms; k++ )
        for ( i = 0; i < 200000; i++ )
            for ( j = 0; j < 1000; j++ )
                test0137_int [j] = (int) floor (test0137_float [j]);

    ret.name = "round test (int)floor()";
    ret.ops  = 200.e6 * ms;
    return ret;
}

void
test0137_init ( void )
{
}

/* The rest will be done by the program around */


-- 
Mit freundlichen Grüßen
Frank Klemm
 
eMail | pfk@uni-jena.de       home: pfk@schnecke.offl.uni-jena.de
      | fingerprint: CDBB D7AE 0488 96B2  E0F9 98C2 1441 051C
phone | +49 (3641) 64-2721    home: +49 (3641) 390545
sMail | R.-Breitscheid-Str. 43, 07747 Jena, Germany

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

end of thread, other threads:[~2013-06-26 18:40 UTC | newest]

Thread overview: 45+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-17  8:55 Proposal Thomas R. Truscott
  -- strict thread matches above, loose matches on Subject: below --
2013-06-26 17:47 Proposal Barrister David Lopez Esq
2013-06-26 17:41 Proposal Barrister David Lopez Esq
2013-06-26 18:15 ` Proposal Paolo Carlini
2013-06-26 18:40   ` Proposal Daniel Santos
2012-09-03 18:35 Proposal Afeez Basit
2012-09-03 15:16 Proposal Afeez Basit
2001-09-19  2:44 Proposal dewar
2001-09-19  2:34 Proposal dewar
2001-09-19  0:06 Proposal dewar
2001-09-18 12:30 Proposal dewar
2001-09-18 23:01 ` Proposal Zack Weinberg
2001-09-18  9:32 Proposal dewar
2001-09-15 11:45 Proposal Frank Klemm
2001-09-15 12:15 ` Proposal Gerald Pfeifer
2001-09-17 16:00 ` Proposal Neil Booth
2001-09-18  2:30   ` Proposal Joseph S. Myers
2001-09-18 10:21     ` Proposal Zack Weinberg
2001-09-18 11:14       ` Proposal Joseph S. Myers
2001-09-18 22:20         ` Proposal Zack Weinberg
2001-09-19  1:14           ` Proposal Joseph S. Myers
2001-09-18 12:23       ` Proposal Frank Klemm
2001-09-18 22:37         ` Proposal Zack Weinberg
2001-09-19  0:02           ` Proposal Neil Booth
2001-09-19  2:23             ` Proposal Tim Hollebeek
2001-09-19  2:41               ` Proposal Richard Earnshaw
2001-09-19 13:38         ` Proposal Joe Buck
2001-09-18 15:35       ` Proposal Robert Lipe
2001-09-18 16:59         ` Proposal Russ Allbery
2001-09-20 11:17           ` Proposal Kai Henningsen
2001-09-20 12:34             ` Proposal Russ Allbery
2001-09-18  9:48   ` Proposal Frank Klemm
2001-09-18 11:06     ` Proposal Neil Booth
2001-09-18 11:37     ` Proposal Kevin Handy
2001-09-18 15:48       ` Proposal Neil Booth
2001-09-18 15:55         ` Proposal Toon Moene
2001-09-27  5:39     ` Proposal Alexandre Oliva
2001-09-27  7:09       ` Proposal Frank Klemm
2001-09-27 16:22         ` Proposal Zack Weinberg
2001-09-29 15:45           ` Proposal Frank Klemm
2001-09-30  9:35             ` Proposal Zack Weinberg
2001-09-27 16:36         ` Proposal Neil Booth
2001-09-29 15:45           ` Proposal Frank Klemm
2001-09-29 17:22             ` Proposal Daniel Jacobowitz
2001-10-03  3:52         ` Proposal Fergus Henderson

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).