[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: compilation warning in error.c
From: |
Werner LEMBERG |
Subject: |
Re: compilation warning in error.c |
Date: |
Wed, 05 Nov 2014 11:03:28 +0100 (CET) |
>> #if _LIBC
>> - __fxprintf (NULL, file_name != NULL ? "%s:%d: " : " ",
>> - file_name, line_number);
>> + if (file_name != NULL)
>> + __fxprintf (NULL, "%s:%d: ", file_name, line_number);
>> + else
>> + __fxprintf (NULL, " ");
>
> The new version is less efficient because it contains more
> instructions, no?
I don't know.
> And the old version is correct.
Well, yes. However, in the case `file_name == NULL', the formatting
string is " ", but there are two arguments for it, so gcc correctly
emits a warning since it might be a programming error with an
incorrect formatting string.
> How about if we call the warning a compiler bug instead?
IMHO, it most certainly isn't a bug in gcc.
Werner