This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Remove __wur attribute for printf/scanf functions


Hello!

Imho the __wur attribute should not be used on printf/scanf functions.

It is not insane to ignore the return value from these. these functions will perform the wanted I/O even though the return value is not used.

Best regards,
Daniel Marjamäki

..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB  Warfvinges väg 34  SE-112 51 Stockholm  Sweden

Mobile:                 +46 (0)709 12 42 62
E-mail:                 Daniel.Marjamaki@evidente.se

www.evidente.se
diff --git a/libio/stdio.h b/libio/stdio.h
index 19ab0ae..2a5f4e7 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -398,13 +398,13 @@ __END_NAMESPACE_C99
    Store the address of the string in *PTR.  */
 extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,
 		      _G_va_list __arg)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
+     __THROWNL __attribute__ ((__format__ (__printf__, 2, 0)));
 extern int __asprintf (char **__restrict __ptr,
 		       const char *__restrict __fmt, ...)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));
 extern int asprintf (char **__restrict __ptr,
 		     const char *__restrict __fmt, ...)
-     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+     __THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));
 #endif
 
 #ifdef __USE_XOPEN2K8
@@ -423,12 +423,12 @@ __BEGIN_NAMESPACE_STD
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int fscanf (FILE *__restrict __stream,
-		   const char *__restrict __format, ...) __wur;
+		   const char *__restrict __format, ...);
 /* Read formatted input from stdin.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
-extern int scanf (const char *__restrict __format, ...) __wur;
+extern int scanf (const char *__restrict __format, ...);
 /* Read formatted input from S.  */
 extern int sscanf (const char *__restrict __s,
 		   const char *__restrict __format, ...) __THROW;
@@ -442,16 +442,16 @@ extern int sscanf (const char *__restrict __s,
    s, S or [.  */
 extern int __REDIRECT (fscanf, (FILE *__restrict __stream,
 				const char *__restrict __format, ...),
-		       __isoc99_fscanf) __wur;
+		       __isoc99_fscanf);
 extern int __REDIRECT (scanf, (const char *__restrict __format, ...),
-		       __isoc99_scanf) __wur;
+		       __isoc99_scanf);
 extern int __REDIRECT_NTH (sscanf, (const char *__restrict __s,
 				    const char *__restrict __format, ...),
 			   __isoc99_sscanf);
 # else
 extern int __isoc99_fscanf (FILE *__restrict __stream,
-			    const char *__restrict __format, ...) __wur;
-extern int __isoc99_scanf (const char *__restrict __format, ...) __wur;
+			    const char *__restrict __format, ...);
+extern int __isoc99_scanf (const char *__restrict __format, ...);
 extern int __isoc99_sscanf (const char *__restrict __s,
 			    const char *__restrict __format, ...) __THROW;
 #  define fscanf __isoc99_fscanf
@@ -470,14 +470,14 @@ __BEGIN_NAMESPACE_C99
    marked with __THROW.  */
 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
 		    _G_va_list __arg)
-     __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+     __attribute__ ((__format__ (__scanf__, 2, 0)));
 
 /* Read formatted input from stdin into argument list ARG.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern int vscanf (const char *__restrict __format, _G_va_list __arg)
-     __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+     __attribute__ ((__format__ (__scanf__, 1, 0)));
 
 /* Read formatted input from S into argument list ARG.  */
 extern int vsscanf (const char *__restrict __s,
@@ -495,10 +495,10 @@ extern int __REDIRECT (vfscanf,
 		       (FILE *__restrict __s,
 			const char *__restrict __format, _G_va_list __arg),
 		       __isoc99_vfscanf)
-     __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;
+     __attribute__ ((__format__ (__scanf__, 2, 0)));
 extern int __REDIRECT (vscanf, (const char *__restrict __format,
 				_G_va_list __arg), __isoc99_vscanf)
-     __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;
+     __attribute__ ((__format__ (__scanf__, 1, 0)));
 extern int __REDIRECT_NTH (vsscanf,
 			   (const char *__restrict __s,
 			    const char *__restrict __format,
@@ -507,9 +507,9 @@ extern int __REDIRECT_NTH (vsscanf,
 #  else
 extern int __isoc99_vfscanf (FILE *__restrict __s,
 			     const char *__restrict __format,
-			     _G_va_list __arg) __wur;
+			     _G_va_list __arg);
 extern int __isoc99_vscanf (const char *__restrict __format,
-			    _G_va_list __arg) __wur;
+			    _G_va_list __arg);
 extern int __isoc99_vsscanf (const char *__restrict __s,
 			     const char *__restrict __format,
 			     _G_va_list __arg) __THROW;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]