From patchwork Wed Aug 12 09:38:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Daniel_Marjam=C3=A4ki?= X-Patchwork-Id: 8147 Received: (qmail 114149 invoked by alias); 12 Aug 2015 09:38:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 114137 invoked by uid 89); 12 Aug 2015 09:38:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.7 required=5.0 tests=AWL, BAYES_50, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mail.evidente.se From: =?iso-8859-1?Q?Daniel_Marjam=E4ki?= To: "libc-alpha@sourceware.org" Subject: [PATCH] Remove __wur attribute for printf/scanf functions Date: Wed, 12 Aug 2015 09:38:42 +0000 Message-ID: MIME-Version: 1.0 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;