aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mk/cc.mk6
-rw-r--r--src/librc/librc-depend.c11
2 files changed, 11 insertions, 6 deletions
diff --git a/mk/cc.mk b/mk/cc.mk
index 225b1104..9bfd123d 100644
--- a/mk/cc.mk
+++ b/mk/cc.mk
@@ -4,6 +4,11 @@
CFLAGS?= -O2 -pipe
+CSTD?= c99
+_CSTD_SH= if test -n "${CSTD}"; then echo "-std=${CSTD}"; else echo ""; fi
+_CSTD!= ${_CSTD_SH}
+CFLAGS+= ${_CSTD}$(shell _CSTD_SH)
+
# GNU Make way of detecting gcc flags we can use
check_gcc=$(shell if ${CC} $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo "$(1)"; else echo "$(2)"; fi)
@@ -23,4 +28,3 @@ CFLAGS+= -pedantic \
$(call check_gcc, -Wdeclaration-after-statement) \
$(call check_gcc, -Wsequence-point) \
$(call check_gcc, -Wextra) ${WEXTRA}
-
diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c
index 1d377309..97e558af 100644
--- a/src/librc/librc-depend.c
+++ b/src/librc/librc-depend.c
@@ -995,17 +995,18 @@ next:
i = 0;
for (depinfo = deptree; depinfo; depinfo = depinfo->next)
{
- fprintf (fp, "depinfo_%lu_service='%s'\n",
- (unsigned long) i, depinfo->service);
+ fprintf (fp, "depinfo_%zu_service='%s'\n",
+ i, depinfo->service);
for (deptype = depinfo->depends; deptype; deptype = deptype->next)
{
k = 0;
STRLIST_FOREACH (deptype->services, service, j)
{
- fprintf (fp, "depinfo_%lu_%s_%lu='%s'\n",
- (unsigned long) i,
+ fprintf (fp,
+ "depinfo_%zu_%s_%zu='%s'\n",
+ i,
deptype->type,
- (unsigned long) k, service);
+ k, service);
k++;
}
}