public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/105362] New: Improvement: diagnose undefined behavior in preprocessing directives
@ 2022-04-24 13:50 pavel.morozkin at gmail dot com
  2022-04-24 16:45 ` [Bug preprocessor/105362] " pinskia at gcc dot gnu.org
  2022-04-25 21:59 ` pavel.morozkin at gmail dot com
  0 siblings, 2 replies; 3+ messages in thread
From: pavel.morozkin at gmail dot com @ 2022-04-24 13:50 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 105362
           Summary: Improvement: diagnose undefined behavior in
                    preprocessing directives
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pavel.morozkin at gmail dot com
  Target Milestone: ---

#if 1 << -1
#endif

$ gcc -std=c11 -pedantic -Wall -Wextra -O3 -c

Expected diagnostics:
warning: left shift count is negative [-Wshift-count-negative]

Actual diagnostics:
<nothing>

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

* [Bug preprocessor/105362] Improvement: diagnose undefined behavior in preprocessing directives
  2022-04-24 13:50 [Bug c/105362] New: Improvement: diagnose undefined behavior in preprocessing directives pavel.morozkin at gmail dot com
@ 2022-04-24 16:45 ` pinskia at gcc dot gnu.org
  2022-04-25 21:59 ` pavel.morozkin at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-04-24 16:45 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
          Component|c                           |preprocessor

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The preprocessor has its own constant folding and diagnostics

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

* [Bug preprocessor/105362] Improvement: diagnose undefined behavior in preprocessing directives
  2022-04-24 13:50 [Bug c/105362] New: Improvement: diagnose undefined behavior in preprocessing directives pavel.morozkin at gmail dot com
  2022-04-24 16:45 ` [Bug preprocessor/105362] " pinskia at gcc dot gnu.org
@ 2022-04-25 21:59 ` pavel.morozkin at gmail dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pavel.morozkin at gmail dot com @ 2022-04-25 21:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Pavel M <pavel.morozkin at gmail dot com> ---
I do believe that evaluation of constant expressions in conditional inclusion
is done according to the rules of constant expressions ("except that ...", see
C11, 6.10.1/1). Hence, I expect the same diagnostics in all the places where
constant expressions may be used.

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

end of thread, other threads:[~2022-04-25 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-24 13:50 [Bug c/105362] New: Improvement: diagnose undefined behavior in preprocessing directives pavel.morozkin at gmail dot com
2022-04-24 16:45 ` [Bug preprocessor/105362] " pinskia at gcc dot gnu.org
2022-04-25 21:59 ` pavel.morozkin at gmail 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).