[Home]

Summary:ASTERISK-12375: [patch] put 'static' at beginning of declarations
Reporter:Guillaume Knispel (gknispel_proformatique)Labels:
Date Opened:2008-07-13 19:45:56Date Closed:2008-07-14 10:36:31
Priority:MinorRegression?No
Status:Closed/CompleteComponents:General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) asterisk_trunk_const_static.patch
( 1) illustration_const_static
Description:Attachement "illustration_const_static" shows that GCC prefers when static is at the beginning of declarations.
The attached patch move them there for the trunk.

It has been produced by
for each in `svnrgrep -l 'const static' .` ; do sed -e "s/const static/static const/g" -i $each ; done
then manual edition of channels/misdn/isdn_lib.c then manual inspection of the whole result then build test.


****** ADDITIONAL INFORMATION ******

russelb said on #asterisk-dev two days ago "i would expect const static and static const to do the same thing, so it can be changed" :)

Also, shamefully stolen from http://linux.derkeiler.com/Mailing-Lists/Kernel/2004-11/6985.html :

This has no impact on functionality and is completely safe, the only
bennefit is less cluttered output from the compiler when building with
gcc -W . This is nice for people like me who build with -W to find
potential troublespots to review (the less warnings to sift through the
better). I can find no argument against fixing this.
Comments:By: Michiel van Baak (mvanbaak) 2008-07-14 10:18:33

nice one.
Maybe we can enable the -W for in --enable-dev-mode.
I'll have a look at the output of it on trunk later today.

By: Tilghman Lesher (tilghman) 2008-07-14 10:33:07

mvanbaak:  -W is already enabled, with an argument:  -Wall

By: Digium Subversion (svnbot) 2008-07-14 10:36:24

Repository: asterisk
Revision: 130697

U   trunk/channels/chan_unistim.c
U   trunk/channels/h323/ast_h323.cxx
U   trunk/channels/misdn/isdn_lib.c
U   trunk/include/asterisk/module.h

------------------------------------------------------------------------
r130697 | tilghman | 2008-07-14 10:36:17 -0500 (Mon, 14 Jul 2008) | 7 lines

Swap "static" and "const", so that "static" appears at the beginning of each
declaration (suppresses a warning).
(closes issue ASTERISK-12375)
Reported by: gknispel_proformatique
Patches:
      asterisk_trunk_const_static.patch uploaded by gknispel (license 261)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=130697