This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Coping with gcc warning due to limitation of gcc analysis?
- From: Florian Weimer <fw at deneb dot enyo dot de>
- To: Samuel Thibault <samuel dot thibault at gnu dot org>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Sat, 27 Jan 2018 23:29:48 +0100
- Subject: Re: Coping with gcc warning due to limitation of gcc analysis?
- Authentication-results: sourceware.org; auth=none
- References: <20180127205417.4eruhvizwf4x2y2c@var.youpi.perso.aquilenet.fr>
* Samuel Thibault:
> What is the glibc-preferred way to deal with this?
The preferred way is to rewrite the code to make it clearer. For
__getresgid, that would probably involve writing to *rgid, *egid,
*sgid directly, without relying on the temporary variables.
For cases where this is not possible, there are the
DIAG_PUSH_NEEDS_COMMENT, DIAG_IGNORE_NEEDS_COMMENT,
DIAG_POP_NEEDS_COMMENT macros.