summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2008-12-24 00:20:04 -0500
committerDave Jones <davej@redhat.com>2008-12-24 00:20:04 -0500
commit54be854db8f001383b3f0e2dccca8dda96e1f678 (patch)
treea03f5057987e3e9db04b119447ed046105a98247
parentfb1741bfba765f6762bab504e0989806e2937401 (diff)
Add some extra warnings (missing declarations) and fix up a bunch
of missing includes, and missed static declarations.
-rw-r--r--AMD/AMD.h2
-rw-r--r--AMD/bluesmoke.c1
-rw-r--r--AMD/dumppsb.c3
-rw-r--r--AMD/identify.c6
-rw-r--r--Centaur/identify.c2
-rw-r--r--Centaur/longhaul.c1
-rw-r--r--Intel/MSR-P4.c1
-rw-r--r--Intel/MSR-P6.c1
-rw-r--r--Intel/bluesmoke.c1
-rw-r--r--Intel/cachesize.c2
-rw-r--r--Makefile2
-rw-r--r--binary.c1
-rw-r--r--features.c2
-rw-r--r--havecpuid.c1
-rw-r--r--lsmsr.c8
15 files changed, 21 insertions, 13 deletions
diff --git a/AMD/AMD.h b/AMD/AMD.h
index 9c8abb0..b37822e 100644
--- a/AMD/AMD.h
+++ b/AMD/AMD.h
@@ -13,7 +13,7 @@ extern void dump_athlon_MSR(struct cpudata *cpu);
extern void dump_k6_MSR (struct cpudata *cpu);
extern void decode_powernow (struct cpudata *cpu);
extern void show_amd_bugs(struct cpudata *cpu);
-extern void dump_PSB(struct cpudata *cpu, int maxfid, int startvid);
+extern void dump_PSB(struct cpudata *cpu, unsigned int maxfid, unsigned int startvid);
#define MSR_CLKCTL 0xc001001b
diff --git a/AMD/bluesmoke.c b/AMD/bluesmoke.c
index 5a3701b..d320268 100644
--- a/AMD/bluesmoke.c
+++ b/AMD/bluesmoke.c
@@ -10,6 +10,7 @@
#include <unistd.h>
#include <sys/types.h>
#include "../x86info.h"
+#include "AMD.h"
#define MCG_CAP 0x0179
#define MCG_STATUS 0x17a
diff --git a/AMD/dumppsb.c b/AMD/dumppsb.c
index 8434137..b43ff1c 100644
--- a/AMD/dumppsb.c
+++ b/AMD/dumppsb.c
@@ -13,8 +13,9 @@
#include <ctype.h>
#include <sys/mman.h>
-#include "powernow.h"
#include "../x86info.h"
+#include "AMD.h"
+#include "powernow.h"
#define START 0x000c0000L
#define END 0x000ffff0L
diff --git a/AMD/identify.c b/AMD/identify.c
index d6d2308..db08c9d 100644
--- a/AMD/identify.c
+++ b/AMD/identify.c
@@ -50,7 +50,7 @@ static void set_k8_name(struct k8_rev *r, struct cpudata *c)
snprintf(c->name, CPU_NAME_LEN, "Unknown CPU");
}
-void set_k8_revinfo(int id, struct cpudata *c)
+static void set_k8_revinfo(int id, struct cpudata *c)
{
int i;
struct k8_rev *r;
@@ -108,7 +108,7 @@ static void set_connector(struct cpudata *c)
}
}
-void set_fam10h_revinfo(int id, struct cpudata *c)
+static void set_fam10h_revinfo(int id, struct cpudata *c)
{
int i;
struct fam10h_rev *r = NULL;
@@ -123,7 +123,7 @@ void set_fam10h_revinfo(int id, struct cpudata *c)
set_connector(c);
}
-void set_fam11h_revinfo(int id, struct cpudata *c)
+static void set_fam11h_revinfo(int id, struct cpudata *c)
{
const char *p;
diff --git a/Centaur/identify.c b/Centaur/identify.c
index 4034363..8fc0f2a 100644
--- a/Centaur/identify.c
+++ b/Centaur/identify.c
@@ -127,7 +127,7 @@ void identify_centaur(struct cpudata *cpu)
}
-void decode_centaur_cacheinfo(struct cpudata *cpu)
+static void decode_centaur_cacheinfo(struct cpudata *cpu)
{
unsigned int eax, ebx, ecx, edx;
diff --git a/Centaur/longhaul.c b/Centaur/longhaul.c
index 9611f51..d0e2e8a 100644
--- a/Centaur/longhaul.c
+++ b/Centaur/longhaul.c
@@ -7,6 +7,7 @@
*/
#include <stdio.h>
#include "../x86info.h"
+#include "centaur.h"
union msr_longhaul {
struct {
diff --git a/Intel/MSR-P4.c b/Intel/MSR-P4.c
index 2a8010d..dbdf45c 100644
--- a/Intel/MSR-P4.c
+++ b/Intel/MSR-P4.c
@@ -11,6 +11,7 @@
#include <unistd.h>
#include <sys/types.h>
#include "../x86info.h"
+#include "Intel.h"
void dump_p4_MSRs (struct cpudata *cpu)
{
diff --git a/Intel/MSR-P6.c b/Intel/MSR-P6.c
index fb989bd..345b6e9 100644
--- a/Intel/MSR-P6.c
+++ b/Intel/MSR-P6.c
@@ -11,6 +11,7 @@
#include <unistd.h>
#include <sys/types.h>
#include "../x86info.h"
+#include "Intel.h"
void dump_p6_MSRs (struct cpudata *cpu)
{
diff --git a/Intel/bluesmoke.c b/Intel/bluesmoke.c
index 6edd3cd..c3e2dd4 100644
--- a/Intel/bluesmoke.c
+++ b/Intel/bluesmoke.c
@@ -10,6 +10,7 @@
#include <unistd.h>
#include <sys/types.h>
#include "../x86info.h"
+#include "Intel.h"
#define MCG_CAP 0x0179
#define MCG_CTL_PBIT 8
diff --git a/Intel/cachesize.c b/Intel/cachesize.c
index 0fa010c..8c13a8a 100644
--- a/Intel/cachesize.c
+++ b/Intel/cachesize.c
@@ -229,7 +229,7 @@ static void decode_cache(struct cpudata *cpu, struct _cache_table *table, int ou
}
}
-void clean_unknowns(struct _cache_table *table)
+static void clean_unknowns(struct _cache_table *table)
{
int j=0;
int des;
diff --git a/Makefile b/Makefile
index 5d64778..6fbeb05 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-CFLAGS = -g -O2 -Werror -Wall -W -Wshadow
+CFLAGS = -g -O2 -Werror -Wall -Wshadow -Wextra -Wmissing-declarations -Wdeclaration-after-statement
CC = gcc
SHELL = /bin/sh
diff --git a/binary.c b/binary.c
index 705e1d6..8d040b6 100644
--- a/binary.c
+++ b/binary.c
@@ -7,6 +7,7 @@
*/
#include <stdio.h>
+#include "x86info.h"
void binary(unsigned int n, unsigned long value)
{
diff --git a/features.c b/features.c
index fe51bb6..4783a32 100644
--- a/features.c
+++ b/features.c
@@ -9,7 +9,7 @@
#include <stdio.h>
#include "x86info.h"
-void flag_decode(unsigned long reg, const char *flags[])
+static void flag_decode(unsigned long reg, const char *flags[])
{
unsigned int i;
diff --git a/havecpuid.c b/havecpuid.c
index 094c82c..4cdce19 100644
--- a/havecpuid.c
+++ b/havecpuid.c
@@ -5,6 +5,7 @@
*/
#include <stdio.h>
+#include "x86info.h"
static int flag_is_changeable_p(unsigned long flag)
{
diff --git a/lsmsr.c b/lsmsr.c
index 056cffb..0c73e0c 100644
--- a/lsmsr.c
+++ b/lsmsr.c
@@ -102,25 +102,25 @@ extern int optind, opterr, optopt;
" \" -r <name|addr>\" overrules \"<MSR>\" overrules \"-a\".\n"\
"\n"
-void usage(void)
+static void usage(void)
{
fprintf(stderr, "Usage: %s "_USAGE, g.prog);
fprintf(stderr, "Try '%s --help' for more information\n", g.prog);
exit(1);
}
-void help(void)
+static void help(void)
{
fprintf(stdout, "Usage: %s "_USAGE, g.prog);
fprintf(stdout, "Help:\n"_HELP);
}
-void version(void)
+static void version(void)
{
fprintf(stdout, "%s version %s\n", g.prog, VERSION);
}
-int get_msr_val(unsigned int msr, unsigned long long *val)
+static int get_msr_val(unsigned int msr, unsigned long long *val)
{
off64_t off;
int err;