[collectd] collectd 5.3.0 / snmp.c - Unable to compile ("ISO C90 forbids mixed declarations and code")

Yves Mettier ymettier at free.fr
Fri Apr 12 12:00:26 CEST 2013


Hello

C90 !?
For those like me who know only C89 (aka ANSI C), C99 and the new C11, 
what is C90 ?

C90 is C89 with some formatting changes only. So for us, C89 and C90 
are the same thing.

Extract from http://gcc.gnu.org/onlinedocs/gcc/Standards.html :
<<
The original ANSI C standard (X3.159-1989) was ratified in 1989 and 
published in 1990. This standard was ratified as an ISO standard 
(ISO/IEC 9899:1990) later in 1990. There were no technical differences 
between these publications, although the sections of the ANSI standard 
were renumbered and became clauses in the ISO standard. This standard, 
in both its forms, is commonly known as C89, or occasionally as C90, 
from the dates of ratification.
>>

About 5.3.1, understanding this is a joke when 5.3.0 was just released, 
I would seriously say no, not so shortly after 5.3.0. Please let us 
install 5.3.0 and have some good time with it :)

Regards,
Yves

Le 2013-04-12 11:08, Andreas Maus a écrit :
> Hi.
>
> Ahh this has been fixed in the reporsitory in
>
> commit 24f69e4d1d6d41c049561431e01c937772b95ba6
>
> I will try this change.
>
> Time for 5.3.1 ? ;)
>
> So long,
>
> Andreas.
>
> On 04/12/13 11:03, Andreas Maus wrote:
>> Good morning.
>>
>> I've tried to compile the brand new collectd 5.3.0 on RHEL5
>> which failed with:
>>
>> [.. snipp ...]
>> cc1: warnings being treated as errors
>> snmp.c: In function 'csnmp_read_table':
>> snmp.c:1381: warning: ISO C90 forbids mixed declarations and code
>> make[3]: *** [snmp_la-snmp.lo] Error 1
>> [.. snipp ...]
>>
>> Although this is just a warning, collectd uses -Werror for
>> the gcc compiler which will result in this error.
>>
>> Looking at the offending line, it seems that the
>> declaration is not neccessary. At least in the
>> code block.
>>
>> [... snipp ...]
>> 1379         /* Calculate the current suffix. This is later used to 
>> check that the
>> 1380          * suffix is increasing. This also checks if we left 
>> the subtree */
>> 1381         int ret;
>> 1382         ret = csnmp_oid_suffix (&suffix, &vb_name, data->values 
>> + i);
>> 1383         if (ret != 0)
>> 1384         {
>> [... snipp ...]
>>
>> Is there a way (except removing the -Werror option) to get a shiny 
>> new collectd
>> with SNMP?
>>
>> Many thanks in advance,
>>
>> Andreas.
>>
>
>
> --
> Dipl.-Ing. Andreas Maus             science+computing ag
> System Administration               Hagellocher Weg 73
> tel.: +49 7071 9457 671             72070 Tuebingen, Germany
> fax: +49 7071 9457 411              www.science-computing.de
> --
> Vorstandsvorsitzender/Chairman of the board of management:
> Gerd-Lothar Leonhart
> Vorstand/Board of Management:
> Dr. Bernd Finkbeiner, Michael Heinrichs, Dr. Arno Steitz, Dr. Ingrid 
> Zech
> Vorsitzender des Aufsichtsrats/
> Chairman of the Supervisory Board:
> Philippe Miltin
> Sitz/Registered Office: Tuebingen
> Registergericht/Registration Court: Stuttgart
> Registernummer/Commercial Register No.: HRB 382196
>
>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd

-- 
- Homepage       - http://ymettier.free.fr                             
-
- GPG key        - http://ymettier.free.fr/gpg.txt                     
-
- C en action    - http://ymettier.free.fr/livres/C_en_action_ed2.html 
-
- Guide Survie C - http://www.pearson.fr/livre/?GCOI=27440100673730    
-



More information about the collectd mailing list