From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.0-prerelease i686; en-US; m18) Gecko/20010202 BuildID: 20020203 In the file xpcom/base/nslog.h macros of the names printf and fprintf are unconditionally defined. This cannot be done after including <stdio.h> without preparation since the system headers can define macros with these names, too. This is the case with recent glibc versions. Reproducible: Always Steps to Reproduce: Compile mozilla on a system with a recent glibc (>= 2.2.1). Actual Results: The compiler emits a warning about printf being redefined. Expected Results: No warning.
Hello, anybody home??? Would somebody please apply the simple patch I submitted? The code as is is wrong (read the C standard) and the patch is definitely not hurting anybody.
Sorry I've been so innattentive. I'll take a look at this patch and your |strtok| patch within the next couple of days.
Status: NEW → ASSIGNED
Your patch looks good to both me and jst but we have one question: is an unconditional |#undef| valid? Or should we be wrapping the |#undef| in a |#ifdef|?
Unconditional #undef are OK. There is no requirement in ISO C that the macro has to be defined before it can be undefined. ISO C99, 126.96.36.199 A preprocessing directive of the form # undef identifier new-line causes the specified identifier no longer to be defined as a macro name. It is ignored if the specified identifier is not currently defined as a macro name.
Cool :-) OK, I'll check this in at my earliest opportunity (==green, open tree).
fix checked in to version 1.5 of "nslog.h"
Status: ASSIGNED → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.