Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Feb 2004 11:36:11 +0100
From:      =?windows-1250?Q?V=E1clav_Haisman?= <V.Haisman@sh.cvut.cz>
To:        <hackers@freebsd.org>
Subject:   Re: how to fool gcc?
Message-ID:  <006a01c3efc1$b3b27710$0a7b2093@amber2>
References:  <xzpad3r5mj4.fsf@dwp.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
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@des.no>
To: <hackers@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)
[...]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?006a01c3efc1$b3b27710$0a7b2093>