bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: more gcc warnings


From: Paul Eggert
Subject: Re: more gcc warnings
Date: Sat, 09 Jul 2005 15:11:51 -0700
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux)

Eric Blake <address@hidden> writes:

> One more that I hadn't paid attention to - for systems with O_BINARY, the
> macro SET_BINARY was using setmode() without a prototype,

Which include file declares setmode()?  Where is this documented?
I looked in the cygwin web site without much luck.

> Should <stdio.h> be included in "system.h"

I'd rather not.  In fact, I'd rather system.h included less than it
already does.

> should we redo this patch to just fix cksum.c to include <stdio.h>

Sorry, I don't follow.  cksum.c already includes <stdio.h>.

> On an unrelated question, I noticed that some files have copyright lines
> that don't match GNU coding standards.

We should fix that, at least for files that we maintain ourselves.

> -# ifndef __DJGPP__
> +# if defined __CYGWIN__
> +#  include <io.h>
> +#  include <stdio.h>
> +# elif !defined __DJGPP__

What is <io.h>?  Why does both it and <stdio.h> need to be included?

While looking at this I did notice that a lot of files include <stdio.h>
that don't need to.  I installed this:

2005-07-09  Paul Eggert  <address@hidden>

        * src/comm.c, src/csplit.c, src/dd.c, src/join.c, src/md5sum.c:
        * src/pr.c, src/sort.c, src/tee.c:
        Don't include stdio.h; no longer needed.

Index: src/comm.c
===================================================================
RCS file: /fetish/cu/src/comm.c,v
retrieving revision 1.84
diff -p -u -r1.84 comm.c
--- src/comm.c  3 Jul 2005 07:16:23 -0000       1.84
+++ src/comm.c  9 Jul 2005 21:56:50 -0000
@@ -19,7 +19,6 @@
 
 #include <config.h>
 
-#include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
Index: src/csplit.c
===================================================================
RCS file: /fetish/cu/src/csplit.c,v
retrieving revision 1.141
diff -p -u -r1.141 csplit.c
--- src/csplit.c        3 Jul 2005 07:17:12 -0000       1.141
+++ src/csplit.c        9 Jul 2005 21:56:51 -0000
@@ -20,7 +20,6 @@
 
 #include <config.h>
 
-#include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
Index: src/dd.c
===================================================================
RCS file: /fetish/cu/src/dd.c,v
retrieving revision 1.184
diff -p -u -r1.184 dd.c
--- src/dd.c    3 Jul 2005 07:17:36 -0000       1.184
+++ src/dd.c    9 Jul 2005 21:56:51 -0000
@@ -18,7 +18,6 @@
 /* Written by Paul Rubin, David MacKenzie, and Stuart Kemp. */
 
 #include <config.h>
-#include <stdio.h>
 
 #define SWAB_ALIGN_OFFSET 2
 
Index: src/join.c
===================================================================
RCS file: /fetish/cu/src/join.c,v
retrieving revision 1.141
diff -p -u -r1.141 join.c
--- src/join.c  3 Jul 2005 07:17:58 -0000       1.141
+++ src/join.c  9 Jul 2005 21:56:51 -0000
@@ -19,7 +19,6 @@
 
 #include <config.h>
 
-#include <stdio.h>
 #include <assert.h>
 #include <sys/types.h>
 #include <getopt.h>
Index: src/md5sum.c
===================================================================
RCS file: /fetish/cu/src/md5sum.c,v
retrieving revision 1.136
diff -p -u -r1.136 md5sum.c
--- src/md5sum.c        3 Jul 2005 07:18:21 -0000       1.136
+++ src/md5sum.c        9 Jul 2005 21:56:51 -0000
@@ -20,7 +20,6 @@
 #include <config.h>
 
 #include <getopt.h>
-#include <stdio.h>
 #include <sys/types.h>
 
 #include "system.h"
Index: src/pr.c
===================================================================
RCS file: /fetish/cu/src/pr.c,v
retrieving revision 1.152
diff -p -u -r1.152 pr.c
--- src/pr.c    3 Jul 2005 07:19:06 -0000       1.152
+++ src/pr.c    9 Jul 2005 21:56:51 -0000
@@ -311,7 +311,6 @@
 
 #include <config.h>
 
-#include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
 #include "system.h"
Index: src/sort.c
===================================================================
RCS file: /fetish/cu/src/sort.c,v
retrieving revision 1.319
diff -p -u -r1.319 sort.c
--- src/sort.c  3 Jul 2005 07:20:04 -0000       1.319
+++ src/sort.c  9 Jul 2005 21:56:52 -0000
@@ -26,7 +26,6 @@
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
-#include <stdio.h>
 #include "system.h"
 #include "error.h"
 #include "hard-locale.h"
Index: src/tee.c
===================================================================
RCS file: /fetish/cu/src/tee.c,v
retrieving revision 1.81
diff -p -u -r1.81 tee.c
--- src/tee.c   3 Jul 2005 07:22:50 -0000       1.81
+++ src/tee.c   9 Jul 2005 21:56:52 -0000
@@ -18,7 +18,6 @@
 /* Mike Parker, Richard M. Stallman, and David MacKenzie */
 
 #include <config.h>
-#include <stdio.h>
 #include <sys/types.h>
 #include <signal.h>
 #include <getopt.h>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]