how to fool gcc?

Václav Haisman V.Haisman at sh.cvut.cz
Tue Feb 10 03:04:15 PST 2004


Fill a GCC PR?
I am not expert in these but is it OK that it evaluates the parameter three
times?

Vaclav Haisman

----- Original Message ----- 
From: "Dag-Erling Smřrgrav" <des at des.no>
To: <hackers at freebsd.org>
Sent: Tuesday, February 10, 2004 10:09 AM
Subject: how to fool gcc?


I'm having trouble with some uncommitted OpenPAM patches that I'd like
to get into the tree.  The problem actually doesn't occur with a
normal build, but it prevents me from building a debugging version of
libpam.

Part of the patch declares openpam_log(3) as printf-like so gcc can
check format strings etc.  However, openpam_log(3) is also used in
debugging macros such as this:

#define RETURNS(s) do { \
        if ((s) == NULL) \
                openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
        else \
                openpam_log(PAM_LOG_DEBUG, "returning '%s'", (s)); \
        return (s); \
} while (0)
[...]



More information about the freebsd-hackers mailing list