Adding new gcc warnings
Julien ÉLIE
julien at trigofacile.com
Sun Apr 14 20:41:58 UTC 2013
Hi all,
As gcc 4.4.x is currently used for the daily generation of snapshots,
maybe we could add new warnings for "make warnings" builds.
I suggest the following flags:
-Wformat-y2k
-Winit-self
-Wold-style-definition
-Wmissing-declarations
-Wnormalized=nfc
-Wpacked
-Winline
-Wsync-nand
-Wvla
Should -Wswitch-default be added? It implies that all switch statements
are required to have a default case, even though all possible cases
are correctly handled.
Should -Wfloat-equal be added? Errors like these ones appear, and
I wonder whether a fix is needed.
In innd/status.c, size is a float:
if (!size) size = 1; /* avoid divide by zero here too */
In innfeed/host.c:
if (h->params->dynBacklogFilter != oldBacklogFilter)
-Wunreachable-code, -Wstrict-overflow=2, -Wtraditional-conversion and
-Wlogical-op give false positives, so I believe adding them is not wise.
Incidentally, a warning is triggered by -Wpacked in include/inn/dbz.h:
typedef struct {
char hash[DBZ_INTERNAL_HASH_SIZE];
} PACKED erec;
Can the PACKED attribute be removed? I do not understand its usefulness for
a struct of only one variable.
-Wold-style-definition returns an issue in innd/icd.c:
char *
ICDreadactive(endp)
char **endp;
{
Can it be replaced with the following definition?
char *
ICDreadactive(char **endp)
{
--
Julien ÉLIE
« Dans un mois, dans un an, comment souffrirons-nous ? » (Jean
Racine)
More information about the inn-workers
mailing list