This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/18604] assert macro-expands its argument
- From: "dak at gnu dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Sun, 28 Jun 2015 10:09:03 +0000
- Subject: [Bug libc/18604] assert macro-expands its argument
- Auto-submitted: auto-generated
- References: <bug-18604-131 at http dot sourceware dot org/bugzilla/>
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.