From c1246d791b00aecc3864c809672fa80154c26aea Mon Sep 17 00:00:00 2001 From: Manvendra Bhangui Date: Mon, 2 Sep 2024 23:02:34 +0530 Subject: [PATCH] added -fpermissive flag --- .github/workflows/tinydnssec-c-cpp.yml | 2 +- tinydnssec-x/curvedns-0.88/configure.ac | 4 +-- tinydnssec-x/curvedns-0.88/nacl/okcompilers/c | 12 ++++---- tinydnssec-x/doc/ChangeLog | 2 ++ tinydnssec-x/dq-20161210/dq/SOURCES | 2 -- tinydnssec-x/dq-20161210/dq/dns_packet.c | 30 ++++++++++++------- tinydnssec-x/dq-20161210/dq/dqcache.c | 3 +- .../dq-20161210/sysdep/direntry.h-dirent.c | 5 ---- .../dq-20161210/sysdep/hasipv6.h-yes.c | 2 +- 9 files changed, 34 insertions(+), 28 deletions(-) diff --git a/.github/workflows/tinydnssec-c-cpp.yml b/.github/workflows/tinydnssec-c-cpp.yml index 04ceef9..c2c7e99 100644 --- a/.github/workflows/tinydnssec-c-cpp.yml +++ b/.github/workflows/tinydnssec-c-cpp.yml @@ -46,7 +46,7 @@ jobs: - name: build_dq run: cd main/tinydnssec-x/dq-20161210; make - name: build_curvedns - run: cd main/tinydnssec-x/curvedns-0.88; env CPPFLAGS="-I/opt/homebrew/Cellar/libev/4.33/include -I/opt/homebrew/Cellar/libsodium/1.0.19/include/sodium" LDFLAGS="-L/opt/homebrew/Cellar/libev/4.33/lib -L/opt/homebrew/Cellar/libsodium/1.0.19/lib" ./default.configure; make + run: if [ "${OS}" = "ubuntu-latest" ] ; then cd main/tinydnssec-x/curvedns-0.88; env CPPFLAGS="-I/opt/homebrew/Cellar/libev/4.33/include -I/opt/homebrew/Cellar/libsodium/1.0.19/include/sodium" LDFLAGS="-L/opt/homebrew/Cellar/libev/4.33/lib -L/opt/homebrew/Cellar/libsodium/1.0.19/lib" ./default.configure; make; fi env: OS: ${{ matrix.host }} diff --git a/tinydnssec-x/curvedns-0.88/configure.ac b/tinydnssec-x/curvedns-0.88/configure.ac index a539627..bd5f3bc 100644 --- a/tinydnssec-x/curvedns-0.88/configure.ac +++ b/tinydnssec-x/curvedns-0.88/configure.ac @@ -48,7 +48,7 @@ case "$host" in ;; *-*-linux*) CPPFLAGS="$CPPFLAGS -DLINUX -I/usr/include/sodium" - CFLAGS="$CFLAGS -g -O4 -Wall -fPIC -fpie" + CFLAGS="$CFLAGS -g -O4 -Wall -fPIC -fpie -fpermissive" LDFLAGS="$LDFLAGS -pie" SYSTEM=Linux ;; @@ -61,7 +61,7 @@ case "$host" in *-*-darwin*) CPPFLAGS="$CPPFLAGS -DDARWIN -I/opt/local/include -I/opt/local/include/qmail -I/opt/local/include/sodium" CPPFLAGS="$CPPFLAGS -I/usr/local/include -I/usr/local/include/sodium" - CFLAGS="$CFLAGS -g -O3 -Wall" + CFLAGS="$CFLAGS -g -O3 -Wall -fpermissive" LDFLAGS="$LDFLAGS -L/opt/local/lib -L/usr/local/lib" SYSTEM=Darwin ;; diff --git a/tinydnssec-x/curvedns-0.88/nacl/okcompilers/c b/tinydnssec-x/curvedns-0.88/nacl/okcompilers/c index 1dbd945..0dfcf0e 100644 --- a/tinydnssec-x/curvedns-0.88/nacl/okcompilers/c +++ b/tinydnssec-x/curvedns-0.88/nacl/okcompilers/c @@ -1,8 +1,8 @@ -gcc -m64 -fomit-frame-pointer -gcc -m64 -O -fomit-frame-pointer -gcc -m64 -O3 -fomit-frame-pointer -funroll-loops -gcc -m32 -fomit-frame-pointer -gcc -m32 -O -fomit-frame-pointer -gcc -m32 -O3 -fomit-frame-pointer -funroll-loops +gcc -m64 -fomit-frame-pointer -fpermissive +gcc -m64 -O -fomit-frame-pointer -fpermissive +gcc -m64 -O3 -fomit-frame-pointer -funroll-loops -fpermissive +gcc -m32 -fomit-frame-pointer -fpermissive +gcc -m32 -O -fomit-frame-pointer -fpermissive +gcc -m32 -O3 -fomit-frame-pointer -funroll-loops -fpermissive spu-gcc -mstdmain -march=cell -O -fomit-frame-pointer -Drandom=rand -Dsrandom=srand spu-gcc -mstdmain -march=cell -O3 -funroll-loops -fomit-frame-pointer -Drandom=rand -Dsrandom=srand diff --git a/tinydnssec-x/doc/ChangeLog b/tinydnssec-x/doc/ChangeLog index 8478457..8000d1c 100644 --- a/tinydnssec-x/doc/ChangeLog +++ b/tinydnssec-x/doc/ChangeLog @@ -90,3 +90,5 @@ Release 1.1 Start 11/04/2017 62. dnstxt.c: fixed infinite loop - 12/02/2024 63. added instcheck-tinydnssec man page +- 02/09/2024 +64. fixed compiler warnings for gcc14 diff --git a/tinydnssec-x/dq-20161210/dq/SOURCES b/tinydnssec-x/dq-20161210/dq/SOURCES index 3772c4f..9c266b3 100644 --- a/tinydnssec-x/dq-20161210/dq/SOURCES +++ b/tinydnssec-x/dq-20161210/dq/SOURCES @@ -25,8 +25,6 @@ dns_resolve dns_sortip dns_transmit dns_verbosity -dq -dqcache droproot e env diff --git a/tinydnssec-x/dq-20161210/dq/dns_packet.c b/tinydnssec-x/dq-20161210/dq/dns_packet.c index 0e0e517..7931dc3 100644 --- a/tinydnssec-x/dq-20161210/dq/dns_packet.c +++ b/tinydnssec-x/dq-20161210/dq/dns_packet.c @@ -40,24 +40,29 @@ long long dns_packet_getname(const unsigned char *buf, long long len, long long long long namelen = 0; for (;;) { - if (pos >= len) goto PROTO; ch = buf[pos++]; + if (pos >= len) goto PROTO; + ch = buf[pos++]; if (++loop >= 1000) goto PROTO; if (state > 0) { - if (namelen + 1 > sizeof name) goto PROTO; name[namelen++] = ch; + if (namelen + 1 > sizeof name) goto PROTO; + name[namelen++] = ch; --state; } else { while (ch >= 192) { where = ch; where -= 192; where <<= 8; - if (pos >= len) goto PROTO; ch = buf[pos++]; + if (pos >= len) goto PROTO; + ch = buf[pos++]; if (!firstcompress) firstcompress = pos; pos = where + ch; - if (pos >= len) goto PROTO; ch = buf[pos++]; + if (pos >= len) goto PROTO; + ch = buf[pos++]; if (++loop >= 1000) goto PROTO; } if (ch >= 64) goto PROTO; - if (namelen + 1 > sizeof name) goto PROTO; name[namelen++] = ch; + if (namelen + 1 > sizeof name) goto PROTO; + name[namelen++] = ch; if (!ch) break; state = ch; } @@ -85,24 +90,29 @@ long long dns_packet_getname_static(const unsigned char *buf, long long len, lon byte_zero(name, 256); for (;;) { - if (pos >= len) goto PROTO; ch = buf[pos++]; + if (pos >= len) goto PROTO; + ch = buf[pos++]; if (++loop >= 1000) goto PROTO; if (state > 0) { - if (namelen + 1 > 255) goto PROTO; name[namelen++] = ch; + if (namelen + 1 > 255) goto PROTO; + name[namelen++] = ch; --state; } else { while (ch >= 192) { where = ch; where -= 192; where <<= 8; - if (pos >= len) goto PROTO; ch = buf[pos++]; + if (pos >= len) goto PROTO; + ch = buf[pos++]; if (!firstcompress) firstcompress = pos; pos = where + ch; - if (pos >= len) goto PROTO; ch = buf[pos++]; + if (pos >= len) goto PROTO; + ch = buf[pos++]; if (++loop >= 1000) goto PROTO; } if (ch >= 64) goto PROTO; - if (namelen + 1 > 255) goto PROTO; name[namelen++] = ch; + if (namelen + 1 > 255) goto PROTO; + name[namelen++] = ch; if (!ch) break; state = ch; } diff --git a/tinydnssec-x/dq-20161210/dq/dqcache.c b/tinydnssec-x/dq-20161210/dq/dqcache.c index 675e5fe..2aa16be 100644 --- a/tinydnssec-x/dq-20161210/dq/dqcache.c +++ b/tinydnssec-x/dq-20161210/dq/dqcache.c @@ -368,7 +368,7 @@ static void doit(void) { u[j].io = io + iolen++; query_io(&u[j].q,u[j].io,&deadline); } - for (j = 0;j < MAXTCP;++j) + for (j = 0;j < MAXTCP;++j) { if (t[j].active) { t[j].io = io + iolen++; if (t[j].state == 0) @@ -379,6 +379,7 @@ static void doit(void) { t[j].io->events = (t[j].state > 0) ? POLLIN : POLLOUT; } } + } timeout = deadline - stamp; if (timeout < 0) timeout = 10; diff --git a/tinydnssec-x/dq-20161210/sysdep/direntry.h-dirent.c b/tinydnssec-x/dq-20161210/sysdep/direntry.h-dirent.c index 674277e..fafa99a 100644 --- a/tinydnssec-x/dq-20161210/sysdep/direntry.h-dirent.c +++ b/tinydnssec-x/dq-20161210/sysdep/direntry.h-dirent.c @@ -4,11 +4,6 @@ int main(int argc,char **argv){ - DIR *dir; - struct dirent *d; - - dir=0; d = 0; - printf("/* Public domain. */\n\n"); printf("#ifndef _DIRENTRY_H____\n"); printf("#define _DIRENTRY_H____\n\n"); diff --git a/tinydnssec-x/dq-20161210/sysdep/hasipv6.h-yes.c b/tinydnssec-x/dq-20161210/sysdep/hasipv6.h-yes.c index 6331979..1d06cf5 100644 --- a/tinydnssec-x/dq-20161210/sysdep/hasipv6.h-yes.c +++ b/tinydnssec-x/dq-20161210/sysdep/hasipv6.h-yes.c @@ -9,7 +9,7 @@ int main() { - int s, r; + int s; struct sockaddr_in6 sa; int opt = 1;