Skip to content

Commit

Permalink
Warnings as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
carlgsmith committed Mar 11, 2024
1 parent 614dd9a commit 72c18a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ LD:=$(CROSS_COMPILE)ld
PKG_CONFIG ?= pkg-config

ABI_VERSION=4
CFLAGS := $(CFLAGS) -g -O2
CFLAGS := $(CFLAGS) -g -O2 -Werror
EXTRA_CFLAGS += -Wall -Wno-comment -std=c99 -D_GNU_SOURCE -fPIC
EXTRA_CFLAGS += -I. $(shell $(PKG_CONFIG) --cflags glib-2.0)
EXTRA_LDFLAGS := -L$(BUILDDIR) $(shell $(PKG_CONFIG) --libs glib-2.0) -lpthread
Expand Down
10 changes: 5 additions & 5 deletions apteryx.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ apteryx_set_full (const char *path, const char *value, uint64_t ts, bool ack)
path = validate_path (path, &url);
if (!path || path[strlen(path) - 1] == '/')
{
ERROR ("SET: invalid path (%s)!\n", path);
ERROR ("SET: invalid path (%s)!\n", path ?: "NULL");
free (url);
assert (!apteryx_debug || path);
return false;
Expand Down Expand Up @@ -795,7 +795,7 @@ apteryx_get (const char *path)
path = validate_path (path, &url);
if (!path || path[strlen(path)-1] == '/')
{
ERROR ("GET: invalid path (%s)!\n", path);
ERROR ("GET: invalid path (%s)!\n", path ?: "NULL");
free (url);
assert (!apteryx_debug || path);
return NULL;
Expand Down Expand Up @@ -2221,7 +2221,7 @@ apteryx_timestamp (const char *path)
if (!path ||
((path[strlen(path)-1] == '/') && strlen(path) > 1))
{
ERROR ("TIMESTAMP: invalid path (%s)!\n", path);
ERROR ("TIMESTAMP: invalid path (%s)!\n", path ?: "NULL");
free (url);
assert (!apteryx_debug || path);
return 0;
Expand Down Expand Up @@ -2265,15 +2265,15 @@ apteryx_memuse (const char *path)
ASSERT ((ref_count > 0), return 0, "MEMUSE: Not initialised\n");
ASSERT (path, return 0, "MEMUSE: Invalid parameters\n");

DEBUG ("MEMUSE: %s\n", path);
DEBUG ("MEMUSE: %s\n", path ?: "NULL");

/* Check path */
path = validate_path (path, &url);
/* if path is empty, or path ends in '/' but is not the root db path (ie "/") */
if (!path ||
((path[strlen(path)-1] == '/') && strlen(path) > 1))
{
ERROR ("MEMUSE: invalid path (%s)!\n", path);
ERROR ("MEMUSE: invalid path (%s)!\n", path ?: "NULL");
free (url);
assert (!apteryx_debug || path);
return 0;
Expand Down

0 comments on commit 72c18a8

Please sign in to comment.