Summary: | locale.h macros like LC_ALL are not usable in #if | ||
---|---|---|---|
Product: | glibc | Reporter: | Paul Eggert <eggert> |
Component: | libc | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | glibc-bugs |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | unspecified | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: | patch for LC_ALL etc. to be usable in #if |
Description
Paul Eggert
2006-10-31 20:08:34 UTC
Created attachment 1396 [details]
patch for LC_ALL etc. to be usable in #if
I don't want to change this. It's a pointless requirement which just makes it harder to debug programs since the macros might not be available in the debug info. But this patch does not make it harder to debug programs, since it is already the case that macros like LC_ALL are typically unavailable in the debug info. <locale.h> has "#define LC_ALL __LC_ALL", and unless you use something like gcc -g3, gdb won't see the LC_ALL. If you like, I can rework the patch so that macros like __LC_ALL are available in the debug info, but I doubt whether any normal users would care so I don't see the point. A better possibility is to rework this patch so that LC_ALL is typically available in the debug info, while still conforming to C99 and POSIX. This would require changing locale.h as well. I can submit that patch if you prefer. (The patches for math.h and fenv.h -- bug 3439 -- are in a different category; I'll look at them a bit later.) More of this macro nonsense. Reopening. We discussed this general issue on #glibc last night. Paul, could you update your patch for current glibc and send it to libc-alpha for review? (Note: I have not checked if any standard C headers other than those mentioned in this bug and bug 3439 are affected by similar issues. And I have not checked if POSIX has the same requirement for integer constant expression macros in POSIX headers, or what bugs there might be in POSIX headers if so.) Fixed by: commit 02467e1ca1745158c99c9b2576b05850028394f7 Author: Paul Eggert <eggert@cs.ucla.edu> Date: Thu May 10 12:38:09 2012 +0000 [PATCH] [BZ #3440] Make LC_ALL etc. useful in #if expressions. |