This is the mail archive of the
mailing list for the glibc project.
Re: [PATCHv2] sysdeps/ieee754: prevent maybe-uninitialized errors [BZ #19444]
On Sun, 30 Sep 2018, Martin Jansa wrote:
> > As per <https://sourceware.org/ml/libc-alpha/2018-09/msg00311.html> I
> > think it would be best to add DIAG_IGNORE_O1_NEEDS_COMMENT to libc-diag.h,
> > and use it for cases such as here that only need the diagnostics disabled
> > for -O1.
> How should I distinguish between -O1 and -O2? For -Os it's simple,
> because there is __OPTIMIZE_SIZE__ defined only when -Os, but for -O1 as
> well as -O2 and -O3 there is __OPTIMIZE__, but I don't know how to find
> out which level is being used. And it's still not completely accurate
> -O1 + -ftree-vrp should be working fine and -O2 + -fno-tree-vrp will
> probably trigger the maybe-uninitialized warning. And I don't see any
> macro defined only when VRP is enabled in gcc.
It looks like that would require a configure test, so maybe a separate
macro there is overkill. Does anyone else have thoughts on this question
of how narrowly to disable warnings for cases that only warn for -O1?
Joseph S. Myers