[Olsr-dev] [PATCH] Fix printf based warning in PUD

Ferry Huberts (spam-protected)
Thu May 24 19:48:34 CEST 2012



On 24-05-12 19:38, Henning Rogge wrote:
> Same for me... strange.
>
> (spam-protected):~$ gcc --version
> gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
> Copyright (C) 2011 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>

this one also didn't catch it:

gcc --version
gcc (Debian 4.4.5-8) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


will file a bug in fedora

I find this very strange since I've clearly annotated the function with 
a format attribute. sigh.



> Henning
>
> On Thu, May 24, 2012 at 7:34 PM, Ferry Huberts<(spam-protected)>  wrote:
>>
>>
>> On 24-05-12 19:33, Henning Rogge wrote:
>>>
>>> Which gcc version are you using?
>>
>>
>> $ gcc --version
>> gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
>> Copyright (C) 2011 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>
>>
>>>
>>> Henning
>>>
>>> On Thu, May 24, 2012 at 4:04 PM, Ferry Huberts<(spam-protected)>    wrote:
>>>>
>>>>
>>>>
>>>> On 24-05-12 15:59, Henning Rogge wrote:
>>>>>
>>>>>
>>>>>   From 21a4b73a4a2c67e458f6865e91b6f20c8de963a4 Mon Sep 17 00:00:00 2001
>>>>> From: Henning Rogge<(spam-protected)>
>>>>> Date: Thu, 24 May 2012 15:56:48 +0200
>>>>> Subject: [PATCH] Fix printf based warning in PUD
>>>>>
>>>>>
>>>>> Signed-off-by: Henning Rogge<(spam-protected)>
>>>>> ---
>>>>> lib/pud/src/configuration.c | 4 ++--
>>>>> 1 files changed, 2 insertions(+), 2 deletions(-)
>>>>>
>>>>> diff --git a/lib/pud/src/configuration.c b/lib/pud/src/configuration.c
>>>>> index 286768c..2be36be 100644
>>>>> --- a/lib/pud/src/configuration.c
>>>>> +++ b/lib/pud/src/configuration.c
>>>>> @@ -344,7 +344,7 @@ static bool intSetupNodeIdBinaryString(void) {
>>>>> invalidChars = nmea_string_has_invalid_chars(nodeid,
>>>>> PUD_NODE_ID_NAME,&report[0], sizeof(report));
>>>>> if (invalidChars) {
>>>>> - pudError(false,&report[0]);
>>>>> + pudError(false, "%s",&report[0]);
>>>>>
>>>>> return false;
>>>>> }
>>>>>
>>>>> @@ -1345,7 +1345,7 @@ int setTxNmeaMessagePrefix(const char *value, void
>>>>> *data __attribute__ ((unused)
>>>>> invalidChars = nmea_string_has_invalid_chars(value,
>>>>> valueName,&report[0],
>>>>> sizeof(report));
>>>>> if (invalidChars) {
>>>>> - pudError(false,&report[0]);
>>>>> + pudError(false, "%s",&report[0]);
>>>>> return true;
>>>>> }
>>>>>
>>>>
>>>> Reviewed-by: Ferry Huberts<(spam-protected)>
>>>>
>>>>
>>>> strange that my compiler didn't catch this...
>>>> --
>>>> Ferry Huberts
>>>>
>>>> --
>>>> Olsr-dev mailing list
>>>> (spam-protected)
>>>> https://lists.olsr.org/mailman/listinfo/olsr-dev
>>>
>>>
>>>
>>>
>>
>> --
>> Ferry Huberts
>
>
>

-- 
Ferry Huberts




More information about the Olsr-dev mailing list