public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug build/28368] New: -Waddress instances in stdio-common/vfprintf-internal.c
@ 2021-09-22  0:11 msebor at gmail dot com
  2021-09-22  0:34 ` [Bug build/28368] " msebor at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: msebor at gmail dot com @ 2021-09-22  0:11 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28368

            Bug ID: 28368
           Summary: -Waddress instances in
                    stdio-common/vfprintf-internal.c
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: build
          Assignee: unassigned at sourceware dot org
          Reporter: msebor at gmail dot com
                CC: carlos at redhat dot com
  Target Milestone: ---

With a recent GCC 12 enhancement to -Waddress a Glibc build shows a large
number of instances of the warning due to comparing the addresses of array
elements for equality to null.  The warnings, all isolated to the same file,
are valid and intended but the Glibc code is safe.  They show up because the
comparison is in a macro to which null is sometimes passed as an argument. 
This bug is to make a record of the warnings to reference in a patch to
suppress them.

vfprintf-internal.c:658:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:672:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:728:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:767:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:911:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:968:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1019:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1063:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1199:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1215:38: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1239:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:658:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:672:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:728:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:767:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:911:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:968:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1019:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1063:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1106:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1121:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1136:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:658:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:672:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:728:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:767:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:911:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:968:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1019:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1063:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1199:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1215:38: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1239:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:658:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:672:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:728:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:767:21: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:911:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:968:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1019:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1063:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1106:17: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1121:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]
vfprintf-internal.c:1136:19: warning: the comparison will always evaluate as
‘false’ for the pointer operand in ‘specs + (sizetype)((long unsigned
int)nspecs_done * 72)’ must not be NULL [-Waddress]

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/28368] -Waddress instances in stdio-common/vfprintf-internal.c
  2021-09-22  0:11 [Bug build/28368] New: -Waddress instances in stdio-common/vfprintf-internal.c msebor at gmail dot com
@ 2021-09-22  0:34 ` msebor at gmail dot com
  2021-09-27 23:56 ` msebor at gmail dot com
  2021-09-28  6:33 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: msebor at gmail dot com @ 2021-09-22  0:34 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28368

--- Comment #1 from Martin Sebor <msebor at gmail dot com> ---
Patch: https://sourceware.org/pipermail/libc-alpha/2021-September/131241.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/28368] -Waddress instances in stdio-common/vfprintf-internal.c
  2021-09-22  0:11 [Bug build/28368] New: -Waddress instances in stdio-common/vfprintf-internal.c msebor at gmail dot com
  2021-09-22  0:34 ` [Bug build/28368] " msebor at gmail dot com
@ 2021-09-27 23:56 ` msebor at gmail dot com
  2021-09-28  6:33 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: msebor at gmail dot com @ 2021-09-27 23:56 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28368

Martin Sebor <msebor at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Martin Sebor <msebor at gmail dot com> ---
Looks like the warnings have disappeared with the following change:
https://sourceware.org/pipermail/glibc-cvs/2021q3/075061.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug build/28368] -Waddress instances in stdio-common/vfprintf-internal.c
  2021-09-22  0:11 [Bug build/28368] New: -Waddress instances in stdio-common/vfprintf-internal.c msebor at gmail dot com
  2021-09-22  0:34 ` [Bug build/28368] " msebor at gmail dot com
  2021-09-27 23:56 ` msebor at gmail dot com
@ 2021-09-28  6:33 ` fweimer at redhat dot com
  2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2021-09-28  6:33 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28368

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
   Target Milestone|---                         |2.35
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-28  6:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22  0:11 [Bug build/28368] New: -Waddress instances in stdio-common/vfprintf-internal.c msebor at gmail dot com
2021-09-22  0:34 ` [Bug build/28368] " msebor at gmail dot com
2021-09-27 23:56 ` msebor at gmail dot com
2021-09-28  6:33 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).