dtc: Enable more warnings
This patch turns on a bunch of extra gcc warnings, most of which are probably a good idea. Of the new warnings -Wnested-externs and -Wstrict-prototypes need no code changes, we're already warning-clean. The remaining one, -Wmissing-prototypes requires trivial changes in some of the tests (making functions local). This patch also rearranges the warnings flags into a separate make variable for convenience, and turns on -Werror, to really encourage people to keep the code warning-clean. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
committed by
Jon Loeliger
parent
8765874963
commit
74f6a51b1f
4
Makefile
4
Makefile
@@ -16,7 +16,9 @@ LOCAL_VERSION =
|
|||||||
CONFIG_LOCALVERSION =
|
CONFIG_LOCALVERSION =
|
||||||
|
|
||||||
CPPFLAGS = -I libfdt
|
CPPFLAGS = -I libfdt
|
||||||
CFLAGS = -Wall -g -Os -fPIC -Wpointer-arith -Wcast-qual
|
WARNINGS = -Werror -Wall -Wpointer-arith -Wcast-qual -Wnested-externs \
|
||||||
|
-Wstrict-prototypes -Wmissing-prototypes
|
||||||
|
CFLAGS = -g -Os -fPIC -Werror $(WARNINGS)
|
||||||
|
|
||||||
BISON = bison
|
BISON = bison
|
||||||
LEX = flex
|
LEX = flex
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
#include "testdata.h"
|
#include "testdata.h"
|
||||||
|
|
||||||
void check_extranull(void *fdt, const char *prop, const char *str, int numnulls)
|
static void check_extranull(void *fdt, const char *prop, const char *str, int numnulls)
|
||||||
{
|
{
|
||||||
int len = strlen(str);
|
int len = strlen(str);
|
||||||
char checkbuf[len+numnulls];
|
char checkbuf[len+numnulls];
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
#include "testdata.h"
|
#include "testdata.h"
|
||||||
|
|
||||||
void check_alias(void *fdt, const char *path, const char *alias)
|
static void check_alias(void *fdt, const char *path, const char *alias)
|
||||||
{
|
{
|
||||||
const char *aliaspath;
|
const char *aliaspath;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
#include "tests.h"
|
#include "tests.h"
|
||||||
#include "testdata.h"
|
#include "testdata.h"
|
||||||
|
|
||||||
void check_alias(void *fdt, const char *full_path, const char *alias_path)
|
static void check_alias(void *fdt, const char *full_path, const char *alias_path)
|
||||||
{
|
{
|
||||||
int offset, offset_a;
|
int offset, offset_a;
|
||||||
|
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ struct val_label labels3[] = {
|
|||||||
{ "end3", -1 },
|
{ "end3", -1 },
|
||||||
};
|
};
|
||||||
|
|
||||||
void check_prop_labels(void *sohandle, void *fdt, const char *name,
|
static void check_prop_labels(void *sohandle, void *fdt, const char *name,
|
||||||
const struct val_label* labels, int n)
|
const struct val_label* labels, int n)
|
||||||
{
|
{
|
||||||
const struct fdt_property *prop;
|
const struct fdt_property *prop;
|
||||||
const char *p;
|
const char *p;
|
||||||
|
|||||||
Reference in New Issue
Block a user