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

Eric Gallager <egall at gwmail dot gwu.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |egall at gwmail dot gwu.edu

--- Comment #2 from Eric Gallager <egall at gwmail dot gwu.edu> ---
(In reply to Martin Sebor from comment #1)
> Confirmed.  The CERT C Coding Standard outlines a number of common problems
> with macros that might be worth considering for inclusion in the proposed
> warning.   The following is the subject of this enhancement request:
> 
>   PRE10-C. Wrap multistatement macros in a do-while loop
>   https://www.securecoding.cert.org/confluence/x/jgL7
> 
> Some other checkers:
> 
>   PRE01-C. Use parentheses within macros around parameter names
>   https://www.securecoding.cert.org/confluence/x/CgU
> 
>   PRE02-C. Macro replacement lists should be parenthesized
>   https://www.securecoding.cert.org/confluence/x/HAs
> 
>   PRE11-C. Do not conclude macro definitions with a semicolon
>   https://www.securecoding.cert.org/confluence/x/wgBlAQ
> 
>   PRE12-C. Do not define unsafe macros
>   https://www.securecoding.cert.org/confluence/x/TIF3Ag
> 
>   PRE31-C. Avoid side effects in arguments to unsafe macros
>   https://www.securecoding.cert.org/confluence/x/agBi

Many of these are also in the CPP manual at:
https://gcc.gnu.org/onlinedocs/cpp/Macro-Pitfalls.html#Macro-Pitfalls
(even though no actual warning is output for any of them yet)

Reply via email to