This is the mail archive of the glibc-bugs@sourceware.org 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]
Other format: [Raw text]

[Bug libc/18604] assert macro-expands its argument


https://sourceware.org/bugzilla/show_bug.cgi?id=18604

--- Comment #1 from David Kastrup <dak at gnu dot org> ---
This has been the case at least for 20 years:

https://sourceware.org/git/?p=glibc.git;a=blob;f=assert/assert.h;hb=28f540f45bbacd939bfd07f213bcad2bf730b1bf

which is the "initial import" in the Git repository (at a time when Git did not
even exist).

I'm surprised there has not been more of a pushback against it.  At any rate,
__STRING is either <em>intended</em> to macro-expand its argument (and there
are use cases for that, like when putting version numbers possibly assembled by
macros into diagnostics) and then its use in "assert" has always been an error,
or it is supposed to cater for non-ANSI preprocessors.

I think we can safely assume that those are gone, even if in 1995 some might
have been around still.

So instead of __STRING(expr) this should really be #expr here.

Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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