warnings in travis

This commit is contained in:
Olof hagsand 2020-02-02 17:07:46 +01:00
parent 7bcd6aed08
commit 7350ec1624
5 changed files with 11 additions and 9 deletions

View file

@ -216,9 +216,11 @@ distclean: clean
.c.o: $(GENSRC)
rm -f $@ && $(CC) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) -c $<
# Compute the length of the date command (and add some extra woith XXX)
DATELEN != date +"%Y.%m.%d %H:%M by `whoami` on `hostname`XXXX"|wc -c
.PHONY: build.c
build.c:
date +"const char CLIXON_BUILDSTR[64]=\"%Y.%m.%d %H:%M by `whoami` on `hostname`"\"\; > build.c;
date +"const char CLIXON_BUILDSTR[$(DATELEN)]=\"%Y.%m.%d %H:%M by `whoami` on `hostname`"\"\; > build.c;
echo "const char CLIXON_VERSION[64]=\"$(CLIXON_VERSION)\""\; >> build.c;
$(MYLIB) : $(GENOBJS) $(OBJS)

View file

@ -228,7 +228,7 @@ keyval_set(char *name,
{
cg_var *cv = NULL;
clicon_debug(1, "%s(%s=%s)", __FUNCTION__, name, val);
clicon_debug(1, "%s(%s=%s)", __FUNCTION__, name?name:"NULL", val);
if ((cv = cv_new(CGV_STRING)) == NULL){
clicon_err(OE_UNIX, errno, "cv_new");
goto done;

View file

@ -622,7 +622,7 @@ stream_notify_xml(clicon_handle h,
cxobj *xev = NULL;
cxobj *xml2; /* copy */
yang_stmt *yspec = NULL;
char *str = NULL;
char *str = NULL; /* XXX: never set */
cbuf *cb = NULL;
char timestr[28];
struct timeval tv;
@ -644,7 +644,7 @@ stream_notify_xml(clicon_handle h,
clicon_err(OE_UNIX, errno, "time2str");
goto done;
}
cprintf(cb, "<notification xmlns=\"urn:ietf:params:xml:ns:netconf:notification:1.0\"><eventTime>%s</eventTime>%s</notification>", timestr, str);
cprintf(cb, "<notification xmlns=\"urn:ietf:params:xml:ns:netconf:notification:1.0\"><eventTime>%s</eventTime>NULL</notification>", timestr); /* XXX str is always NULL */
if (xml_parse_string(cbuf_get(cb), yspec, &xev) < 0)
goto done;
if (xml_rootchild(xev, 0, &xev) < 0)

View file

@ -41,8 +41,10 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define __USE_GNU /* For setresuid */
#include <unistd.h>
#define _GNU_SOURCE
#define __USE_GNU
#include <unistd.h> /* For setresuid */
#undef _GNU_SOURCE
#undef __USE_GNU
#include <stdarg.h>
#include <signal.h>
@ -165,6 +167,7 @@ drop_priv_temp(uid_t new_uid)
{
int retval = -1;
/* XXX: implicit declaration of function 'setresuid' on travis */
if (setresuid(-1, new_uid, geteuid()) < 0){
clicon_err(OE_UNIX, errno, "setresuid");
goto done;

View file

@ -246,9 +246,6 @@ identifier [A-Za-z_][A-Za-z0-9_\-\.]*
<STRINGSQ>[^'\n]+ { clixon_yang_parselval.string = strdup(yytext);
return CHARS;}
<DQESC>[nt"\\] { BEGIN(_YY->yy_lex_state);
clixon_yang_parselval.string = strdup(yytext);
return CHARS; }
<DQESC>[nt"\\] { BEGIN(_YY->yy_lex_state);
clixon_yang_parselval.string = strdup(yytext);
return CHARS; }