From a82201f388e8d4b4b5b10b9547c3ee3a4e488586 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 16 Nov 2014 18:12:50 +0200 Subject: [PATCH] Enable strict standards conformance and fix resulting errors --- Makefile | 2 +- main.c | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dd03d7c..1632770 100644 --- a/Makefile +++ b/Makefile @@ -1,2 +1,2 @@ pmount-gui: main.c - $(CC) -Wall -Wextra -o $@ $^ $(shell pkg-config --cflags --libs gtk+-2.0) + $(CC) -Wall -Wextra -std=c90 -pedantic -o $@ $^ $(shell pkg-config --cflags --libs gtk+-2.0) diff --git a/main.c b/main.c index 916c2e2..6392130 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,5 @@ +/* Required for strdup, snprintf, getopt */ +#define _XOPEN_SOURCE 500 #include #include #include @@ -7,6 +9,7 @@ #include #include #include +#include #include #include @@ -427,10 +430,12 @@ Device *get_devices(void) for(i=0; nodes[i]; ++i) { + Property *props; + if(verbosity>=1) printf("Examining device %s\n", nodes[i]); - Property *props = get_device_properties(nodes[i]); + props = get_device_properties(nodes[i]); if(!props) { if(verbosity>=2) -- 2.43.0