lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #7130] mib2.c: remove meaningless const qualifiers


From: Luca Ceresoli
Subject: [lwip-devel] [patch #7130] mib2.c: remove meaningless const qualifiers
Date: Fri, 26 Mar 2010 17:18:41 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2

Follow-up Comment #17, patch #7130 (project lwip):

Sorry for lighting such a fire...

My understanding is that
> struct mib_node* const snmp_nodes[28]
declares an array of immutable pointers, hence repeating the constness for
each member is redundant (not useful, not hurting).
I cannot explain why my compiler is so hurt by that, though.

The intent of my patch was to remove a deliberately useless specifier to
clean up code and (in my case) remove warnings.

My picky compiler's help page about this warning follows.

--------------8<------------------

Compiler Warning: type qualifier is meaningless on cast type

Description:
The compiler has encountered casting to a qualified type. The statement is
valid, but pointless.

Severity:
Warning

Recovery:
After the warning, compilation continues.

Example:
int main()
{
int Num = 1;
int Num_c = (const)Num;
}

How to Fix:
The statement is pointless. Therefore, change the source to ensure that
removing the statement will have no ill effect on the program.

Related Information:
ISO/IEC 9899:1990 "Programming Languages - C"
ISO/IEC 14882:1998 "Programming Languages - C++" (5.2.7, 5.2.9, 5.2.10)

--------------8<------------------


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?7130>

_______________________________________________
  Messaggio inviato con/da Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]