This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch for undefined behaviour in gcc


Neil Booth <NeilB@earthling.net> writes:

> You said on the kernel mailing list the other day you don't want to
> break glibc to fix syslogd.

You did not even understand the argumentation there.  If you would you
wouldn't come up with such a stupid argumentation.

> Well, I feel the same about cpp and glibc.

You are breaking code which worked for ages.  It is 100% reliable in
the context we are using it in and issuing the warning is plainly
wrong.  Use the options which select ISO C as the language and issue
the warning then.  The warning is simply wrong in this context.

And to be concrete: the replacements in Andreas' patch are not
equivalent with the original code.  Just for you a demonstration:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define foo defined(bar)


#define bar     <---- somewhere in between, maybe foo get redefined, too


#if foo
# define baz   10
#else
# define baz
#endif

int vbaz = baz;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How except when using this extension can you write code like this?  If
you don't know at which point `bar' is defined using the trick is the
only way out.

All these "cleanups" of the language you came up with are
counterproductive.  You claim to have the right to decide how people
write their code and rewriting the (implicit) GNU C specification.
Ignoring warnings is often no option and is always irritating which is
why you force people to comply with your rules.  This is simply not
acceptable.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]