public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug analyzer/105103] New: RFE: detect bogus use of varargs in analyzer
@ 2022-03-29 20:17 dmalcolm at gcc dot gnu.org
  2022-04-11 14:21 ` [Bug analyzer/105103] " dmalcolm at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dmalcolm at gcc dot gnu.org @ 2022-03-29 20:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105103

            Bug ID: 105103
           Summary: RFE: detect bogus use of varargs in analyzer
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: analyzer
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

The analyzer doesn't yet have any handling for the types, macros, functions
from <stdarg.h>:

https://en.cppreference.com/w/c/variadic
https://www.man7.org/linux/man-pages/man3/stdarg.3.html

It would be nice to e.g. detect the various undefined behaviors listed in the
above e.g. 

"If ap is passed to a function that uses va_arg(ap,type), then the value of ap
is undefined after the return of that function."

etc.

We could also implement __builtin_va_start, __builtin_va_end, etc
and have region_model unpack variadic args in interprocedural calls,
effectively inlining the analysis.

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

end of thread, other threads:[~2022-05-16 19:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 20:17 [Bug analyzer/105103] New: RFE: detect bogus use of varargs in analyzer dmalcolm at gcc dot gnu.org
2022-04-11 14:21 ` [Bug analyzer/105103] " dmalcolm at gcc dot gnu.org
2022-05-16 19:35 ` cvs-commit at gcc dot gnu.org
2022-05-16 19:43 ` dmalcolm at gcc dot gnu.org

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).