This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Add <stdint.h> integer width macros
- From: Florian Weimer <fweimer at redhat dot com>
- To: Ovidiu M <mrovi9000 at gmail dot com>, joseph at codesourcery dot com
- Cc: libc-alpha at sourceware dot org
- Date: Sun, 5 Mar 2017 13:05:04 +0100
- Subject: Re: Add <stdint.h> integer width macros
- Authentication-results: sourceware.org; auth=none
- References: <CAObTSWXdKPAggWf3N4VDzAk__DrYQcidut=1YC1GYMB92EQA-g@mail.gmail.com>
On 03/05/2017 10:50 AM, Ovidiu M wrote:
Hi Joseph,
The new macro SIZE_WIDTH conflicts with a definition in one of my
projects, breaking compilation (
https://gitlab.com/o9000/tint2/issues/625 ) with gcc 7 (which IIUC is
a pre-release version).
Removing _GNU_SOURCE is a workaround which will address many such issues.
Could you please tell me if there is anything I can do about it, other
than renaming that variable?
You can participate in glibc development. Current consensus here is
that _GNU_SOURCE should be adjusted in every release to reflect a
superset of all standards supported by glibc (where those standards do
not conflict). This does have its problems, and particularly reckless
ISO revisions might force the community to adopt.
Another option is to participate in the ISO standardization process and
explain to these people that new identifiers added to existing header
files should use some construct (such as a suitable prefix) to reduce
the risk of collisions. Or perhaps non-core standards should stop
patching existing header files altogether and add new ones, which would
also resolve the backwards compatibility issue.
At some point in the future, it is likely that switching to C++ will
also reduce such issues because C++ relies less heavily on macros, and
identifiers can be nested in namespaces. At present, this is not really
an option because the GNU C++ implementation (via libstdc++) relies on
_GNU_SOURCE.
Thanks,
Florian