INN commit: branches/2.6 (12 files)

INN Commit rra at isc.org
Sun Jul 31 20:01:44 UTC 2016


    Date: Sunday, July 31, 2016 @ 13:01:43
  Author: iulius
Revision: 10040

Fix the build on old GCC versions

To build with GCC "-Wformat-nonliteral" warning on, [9911] suppressed a
few checks in the code, waiting to be properly fixed.  However, these
pragmas are not understood by old GCC versions (4.4.7 for instance).
So this commit suppresses these pragmas.

They are scheduled to be fixed in a later release of INN.

Modified:
  branches/2.6/Makefile.global.in
  branches/2.6/backends/batcher.c
  branches/2.6/backends/buffchan.c
  branches/2.6/backends/ninpaths.c
  branches/2.6/frontends/rnews.c
  branches/2.6/innd/site.c
  branches/2.6/innfeed/imap_connection.c
  branches/2.6/innfeed/misc.c
  branches/2.6/lib/getmodaddr.c
  branches/2.6/nnrpd/post.c
  branches/2.6/support/getc-tap-harness
  branches/2.6/tests/tap/basic.c

---------------------------+
 Makefile.global.in        |    4 ++--
 backends/batcher.c        |    4 ----
 backends/buffchan.c       |    2 --
 backends/ninpaths.c       |    2 --
 frontends/rnews.c         |    4 ----
 innd/site.c               |    4 ----
 innfeed/imap_connection.c |    4 ----
 innfeed/misc.c            |    2 --
 lib/getmodaddr.c          |    4 ----
 nnrpd/post.c              |    2 --
 support/getc-tap-harness  |    4 ----
 tests/tap/basic.c         |    4 ----
 12 files changed, 2 insertions(+), 38 deletions(-)

Modified: Makefile.global.in
===================================================================
--- Makefile.global.in	2016-06-02 15:08:09 UTC (rev 10039)
+++ Makefile.global.in	2016-07-31 20:01:43 UTC (rev 10040)
@@ -92,11 +92,11 @@
 ##  -D_FORTIFY_SOURCE=2 enables warn_unused_result attribute markings
 ##  on glibc functions on Linux, as well as more object size checking,
 ##  which catches a few more issues.
-##  -Wswitch-enum, -Wfloat-equal, -Wlogical-op,
+##  -Wformat=2, -Wswitch-enum, -Wfloat-equal, -Wlogical-op,
 ##  "-Wconversion -Wno-sign-conversion",
 ##  -Wunreachable-code, -Wstack-protector, -Wdeclaration-after-statement
 
-WARNINGS	= -g -O2 -DDEBUG=1 -Werror -Wall -Wextra -Wformat=2 \
+WARNINGS	= -g -O2 -DDEBUG=1 -Werror -Wall -Wextra \
 		  -Winit-self -Wmissing-include-dirs \
 		  -Wsync-nand -Wendif-labels -Wtrampolines -Wpointer-arith \
 		  -Wbad-function-cast -Wcast-align -Wwrite-strings \

Modified: backends/batcher.c
===================================================================
--- backends/batcher.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ backends/batcher.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -54,9 +54,7 @@
     char	buff[SMBUF];
 
     if (Processor && *Processor) {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 	snprintf(buff, sizeof(buff), Processor, Host);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
 	F = popen(buff, "w");
 	if (F == NULL)
 	    return NULL;
@@ -372,9 +370,7 @@
     SendIt:
 	/* Now we can start to send the article! */
 	if (Separator && *Separator) {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 	    snprintf(buff, sizeof(buff), Separator, BytesInArt);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
 	    BytesInCB += strlen(buff) + 1;
 	    BytesWritten += strlen(buff) + 1;
 	    if (fprintf(F, "%s\n", buff) == EOF || ferror(F)) {

Modified: backends/buffchan.c
===================================================================
--- backends/buffchan.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ backends/buffchan.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -177,9 +177,7 @@
 
     /* Fill in the structure for the new site. */
     sp->Name = xstrdup(Name);
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     snprintf(buff, sizeof(buff), Format, Map ? MAPname(Name) : sp->Name);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     sp->Filename = xstrdup(buff);
     if (BufferMode == 'u')
 	sp->Buffer = NULL;

Modified: backends/ninpaths.c
===================================================================
--- backends/ninpaths.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ backends/ninpaths.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -199,9 +199,7 @@
 	writedump(stdout);
 	return;
     }
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     snprintf(buf, sizeof(buf), n, time(0));
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     d=fopen(buf, "w");
     if (d) {
 	if (writedump(d)<0)

Modified: frontends/rnews.c
===================================================================
--- frontends/rnews.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ frontends/rnews.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -170,14 +170,10 @@
     int fd;
 #endif	/* defined(DO_RNEWS_SAVE_BAD) */
 
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     notice(reason, arg);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     if (Verbose) {
 	fprintf(stderr, "%s: ", InputFile);
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 	fprintf(stderr, reason, arg);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
 	fprintf(stderr, " [%.40s...]\n", article);
     }
 

Modified: innd/site.c
===================================================================
--- innd/site.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ innd/site.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -530,14 +530,10 @@
 	    strlcat(temp, sp->FNLnames.data, i + 1);
 	    strlcat(temp, &p[1], i + 1);
 	    *p = '*';
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 	    snprintf(buff, sizeof(buff), temp, Data->TokenText);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
 	    free(temp);
 	} else {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
 	    snprintf(buff, sizeof(buff), sp->Param, Data->TokenText);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
         }
 
 	if (NeedShell(buff, (const char **)argv, (const char **)ARRAY_END(argv))) {

Modified: innfeed/imap_connection.c
===================================================================
--- innfeed/imap_connection.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ innfeed/imap_connection.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -3650,9 +3650,7 @@
 
     c = newrcpt[newrcptlen];
     newrcpt[newrcptlen] = '\0';
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     size += snprintf((*out) + size, newsize - size, deliver_rcpt_to, newrcpt);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     newrcpt[newrcptlen] = c;
 
     strlcpy((*out) + size, ">\r\n", newsize - size);
@@ -3727,9 +3725,7 @@
 
     c = newrcpt[newrcptlen];
     newrcpt[newrcptlen] = '\0';
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     size += snprintf((*out) + size, newsize - size, deliver_to_header,newrcpt);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     newrcpt[newrcptlen] = c;
 
     strlcpy((*out) + size, ">", newsize - size);

Modified: innfeed/misc.c
===================================================================
--- innfeed/misc.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ innfeed/misc.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -593,10 +593,8 @@
 {
   static const char defaultFormat[] = "%a %b %d %H:%M:%S %Y" ;
   const struct tm *const tm = localtime(&t);
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
   strftime (buffer, size,
     timeToStringFormat == 0 ? defaultFormat : timeToStringFormat, tm);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
   return buffer;
 }
 

Modified: lib/getmodaddr.c
===================================================================
--- lib/getmodaddr.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ lib/getmodaddr.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -201,9 +201,7 @@
 		    if (*p == '.')
 			*p = '-';
                 if (IsValidSubmissionTemplate(save)) {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
                     snprintf(address, sizeof(address), save, name);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
                     break;
                 }
 	    }
@@ -223,9 +221,7 @@
 	    *p = '-';
 
     if (IsValidSubmissionTemplate(save)) {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
         snprintf(address, sizeof(address), save, name);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     } else {
         return NULL;
     }

Modified: nnrpd/post.c
===================================================================
--- nnrpd/post.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ nnrpd/post.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -705,9 +705,7 @@
      * in case %s isn't in inconf->mta) and send the headers. */
     if (innconf->mta == NULL)
 	return "Can't start mailer -- mta not set";
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     snprintf(buff, sizeof(buff), innconf->mta, address);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
     if ((F = popen(buff, "w")) == NULL)
 	return "Can't start mailer";
     fprintf(F, "To: %s\n", address);

Modified: support/getc-tap-harness
===================================================================
--- support/getc-tap-harness	2016-06-02 15:08:09 UTC (rev 10039)
+++ support/getc-tap-harness	2016-07-31 20:01:43 UTC (rev 10040)
@@ -93,9 +93,7 @@
 void\\
 skip(int n UNUSED, const char *reason)\\
 {\\
-#pragma GCC diagnostic ignored \"-Wformat-nonliteral\"\\
     new_skip(reason, NULL);\\
-#pragma GCC diagnostic warning \"-Wformat-nonliteral\"\\
 }\\
 \\
 void\\
@@ -107,9 +105,7 @@
 void\\
 skip_block(int n UNUSED, int count, const char *reason)\\
 {\\
-#pragma GCC diagnostic ignored \"-Wformat-nonliteral\"\\
     new_skip_block(count, reason, NULL);\\
-#pragma GCC diagnostic warning \"-Wformat-nonliteral\"\\
 }\\
 \\
 void\\

Modified: tests/tap/basic.c
===================================================================
--- tests/tap/basic.c	2016-06-02 15:08:09 UTC (rev 10039)
+++ tests/tap/basic.c	2016-07-31 20:01:43 UTC (rev 10040)
@@ -72,9 +72,7 @@
 void
 skip(int n UNUSED, const char *reason)
 {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     new_skip(reason, NULL);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
 }
 
 void
@@ -86,9 +84,7 @@
 void
 skip_block(int n UNUSED, int count, const char *reason)
 {
-#pragma GCC diagnostic ignored "-Wformat-nonliteral"
     new_skip_block(count, reason, NULL);
-#pragma GCC diagnostic warning "-Wformat-nonliteral"
 }
 
 void



More information about the inn-committers mailing list