Skip to content

Commit 05d6cd8

Browse files
committed
fix pedantic warnings
The code now compiles under gcc version 15.2.0 with all warnings and pedantic warnings enabled. Fixed a number of problems related arguments of pointers to functions. Added lines, commented out, in the macOS Address Sanitizer (ASAN) section to support use of HomeBrew gcc version 15.
1 parent 7c650ad commit 05d6cd8

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

Makefile

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ CFILES= vers.c extern.c armor.c chase.c command.c daemon.c \
168168

169169
MISC_C= findpw.c scedit.c scmisc.c
170170

171-
C_SRC= ${CFILES} ${MISC_C}
171+
C_SRC= ${CFILES} ${MISC_C}
172172

173173
SRC= ${C_SRC} ${H_SRC}
174174

@@ -239,15 +239,21 @@ FSANITIZE+= -fsanitize=vptr
239239
#
240240
# We recommend, for ease of debugging, building a static calc ("BLD_TYPE= calc-static-only").
241241
#
242-
# FSANITIZE+= -fsanitize=nullability-arg
243-
# FSANITIZE+= -fsanitize=nullability-assign
244-
# FSANITIZE+= -fsanitize=nullability-return
242+
# For HomeBrew gcc version 15:
243+
#
244+
# CC:= gcc-15
245+
# DEBUG:= -g2
246+
#
245247
# CCWARN+= -Wall
246248
# CCWARN+= -pedantic
247249
# CCWARN+= -Werror
250+
# COPT:= -O0
251+
#
252+
# FSANITIZE+= -fsanitize=nullability-arg
253+
# FSANITIZE+= -fsanitize=nullability-assign
254+
# FSANITIZE+= -fsanitize=nullability-return
248255
# CFLAGS+= ${FSANITIZE} -fstack-protector-all
249256
# LDFLAGS+= ${FSANITIZE}
250-
# COPT:= -O0
251257
# DEBUG:= -ggdb3
252258
####
253259

@@ -279,6 +285,7 @@ FSANITIZE+= -fsanitize=vptr
279285
# CCWARN+= -Wall
280286
# CCWARN+= -pedantic
281287
# CCWARN+= -Werror
288+
#
282289
# CFLAGS+= ${FSANITIZE} -fstack-protector-all
283290
# LDFLAGS+= ${FSANITIZE}
284291
# COPT:= -O0

scedit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ main(int ac, char *av[])
9898
perror("calloc for scorefile failed");
9999
exit(1);
100100
}
101-
snprintf(scorefile, MAXSTR+scorename_len, "%s%s", home, SCORENAME);
101+
snprintf(scorefile, MAXSTR+scorename_len+1, "%s%s", home, SCORENAME);
102102
} else {
103103
scorefile = av[1];
104104
}

0 commit comments

Comments
 (0)