From c8f382c07e2e75ee840b80600d3d55d6a8232680 Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 25 Jan 2019 08:02:28 +0100 Subject: [PATCH 1/2] Makefile: Use more effective compile flags The ones added are pretty common, and useful. -O2 often gives a real performance boost. -g gives us the needed debug symbols, and makes it much easier to blame the coder :) N.B. -Wterror -Wextra -pedantic are (IMHO) of limited use, they just point to lesser errors, not the real ones. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 71e20bd..113d158 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # CFLAGS= -Wall -Werror -Wextra -pedantic \ - -std=gnu99 + -std=gnu99 -O2 -g LDFLAGS=-lm -lXaw -lXt -lX11 # gcc -o xdu -O2 -fno-strength-reduce -fno-strict-aliasing -L/usr/lib64 xdu.o xwin.o -lXaw -lXmu -lXt -lSM -lICE -lXpm -lXext -lX11 From b5fda28b57de6790db8b5edb62d5db9b1eba3e2b Mon Sep 17 00:00:00 2001 From: thomas Date: Fri, 25 Jan 2019 08:18:03 +0100 Subject: [PATCH 2/2] xdu.c: Fixes need to compile xdu.c with -O2 I've choosen 'n/a' as initial string, because this clearly isn't a filename. --- xdu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xdu.c b/xdu.c index 37b0a02..c5c1413 100644 --- a/xdu.c +++ b/xdu.c @@ -999,7 +999,7 @@ void savepschildren(FILE* fp, struct node* nodep, struct rect rect, int showsize height, top; struct node* np; - char *name, + char *name="n/a", label[1024]; struct rect subrect; @@ -1148,7 +1148,7 @@ void fprintsvgnode(FILE* fp, struct rect rect) void fprintsvgnodetext(FILE* fp, int x, int y, long long size, char* name, int showsize) { char buffer[1024], - *text; + *text="n/a"; switch (showsize) { case 0: