[PATCH] io/ftw.h: Fix "comma at end of enumerator list" compilation warnings

Dmitry V. Levin ldv@altlinux.org
Tue May 5 23:10:00 GMT 2009


Hi,

Current edition of io/ftw.h does not support -pedantic mode:

$ gcc -pedantic -c -o/dev/null /usr/include/ftw.h
/usr/include/ftw.h:49: warning: comma at end of enumerator list
$ gcc -D_XOPEN_SOURCE -pedantic -c -o/dev/null /usr/include/ftw.h
/usr/include/ftw.h:44: warning: comma at end of enumerator list
$ gcc -D_GNU_SOURCE -pedantic -c -o/dev/null /usr/include/ftw.h
/usr/include/ftw.h:99: warning: comma at end of enumerator list

2009-05-05  Dmitry V. Levin  <ldv@altlinux.org>

	* io/ftw.h: Fix enum commas placement to avoid compilation
	warnings in -pedantic mode.

--- io/ftw.h
+++ io/ftw.h
@@ -41,16 +41,17 @@ enum
 #define FTW_D	 FTW_D
   FTW_DNR,		/* Unreadable directory.  */
 #define FTW_DNR	 FTW_DNR
-  FTW_NS,		/* Unstatable file.  */
+  FTW_NS		/* Unstatable file.  */
 #define FTW_NS	 FTW_NS
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
-
-  FTW_SL,		/* Symbolic link.  */
+  ,
+  FTW_SL		/* Symbolic link.  */
 # define FTW_SL	 FTW_SL
 #endif
 
 #ifdef __USE_XOPEN_EXTENDED
+  ,
 /* These flags are only passed from the `nftw' function.  */
   FTW_DP,		/* Directory, all subdirs have been visited. */
 # define FTW_DP	 FTW_DP
@@ -96,7 +97,7 @@ enum
 			   subtree, instead just continue with its next
 			   sibling. */
 # define FTW_SKIP_SUBTREE FTW_SKIP_SUBTREE
-  FTW_SKIP_SIBLINGS = 3,/* Continue with FTW_DP callback for current directory
+  FTW_SKIP_SIBLINGS = 3	/* Continue with FTW_DP callback for current directory
 			    (if FTW_DEPTH) and then its siblings.  */
 # define FTW_SKIP_SIBLINGS FTW_SKIP_SIBLINGS
 };


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20090505/92eddd58/attachment.sig>


More information about the Libc-alpha mailing list