Change the order of function attributes in printf.h

Message ID 1490215182-14217-1-git-send-email-tuliom@linux.vnet.ibm.com
State Committed
Headers

Commit Message

Tulio Magno Quites Machado Filho March 22, 2017, 8:39 p.m. UTC
  According to ISO C++, exception specification must appear before of the
attribute specifier when declaring functions.

This patch fix issues reported by stdio-common/check-installed-headers-cxx.

2017-03-22  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>

	* stdio-common/printf.h (register_printf_modifier): Change the
	order of __wur and __THROW.
	(register_printf_type) Likewise.
---
 stdio-common/printf.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Tulio Magno Quites Machado Filho March 23, 2017, 5:36 p.m. UTC | #1
Zack Weinberg <zackw@panix.com> writes:

> LGTM. Please cite the specific section of the C++ standard that makes this
> requirement in your commit message.

What about this?

According to ISO C++ in subclause 8.3.5 [dcl.fct], exception specification
must appear before the attribute specifier when declaring functions.


P.S.: It looks like your message never reached libc-alpha.
  
Zack Weinberg March 23, 2017, 5:40 p.m. UTC | #2
On Thu, Mar 23, 2017 at 1:36 PM, Tulio Magno Quites Machado Filho
<tuliom@linux.vnet.ibm.com> wrote:
> Zack Weinberg <zackw@panix.com> writes:
>> LGTM. Please cite the specific section of the C++ standard that makes this
>> requirement in your commit message.
>
> What about this?
>
> According to ISO C++ in subclause 8.3.5 [dcl.fct], exception specification
> must appear before the attribute specifier when declaring functions.

Sounds good.  If you don't mind some English polishing,

# ISO C++ section 8.3.5 [dcl.fct] requires exception specifications
# to appear before attribute specifiers in function declarations.

> P.S.: It looks like your message never reached libc-alpha.

Yes, apparently I can't send plaintext email from my phone :-(

zw
  
Tulio Magno Quites Machado Filho March 23, 2017, 6:50 p.m. UTC | #3
Zack Weinberg <zackw@panix.com> writes:

> [ text/plain ]
> On Thu, Mar 23, 2017 at 1:36 PM, Tulio Magno Quites Machado Filho
> <tuliom@linux.vnet.ibm.com> wrote:
>> Zack Weinberg <zackw@panix.com> writes:
>>> LGTM. Please cite the specific section of the C++ standard that makes this
>>> requirement in your commit message.
>>
>> What about this?
>>
>> According to ISO C++ in subclause 8.3.5 [dcl.fct], exception specification
>> must appear before the attribute specifier when declaring functions.
>
> Sounds good.  If you don't mind some English polishing,
>
> # ISO C++ section 8.3.5 [dcl.fct] requires exception specifications
> # to appear before attribute specifiers in function declarations.

Fixed and pushed as ca4dc74659.

Thanks!
  

Patch

diff --git a/stdio-common/printf.h b/stdio-common/printf.h
index bf5ccd4..5d82e8d 100644
--- a/stdio-common/printf.h
+++ b/stdio-common/printf.h
@@ -111,13 +111,13 @@  extern int register_printf_function (int __spec, printf_function __func,
    it returns a positive value representing the bit set in the USER
    field in 'struct printf_info'.  */
 
-extern int register_printf_modifier (const wchar_t *__str) __wur __THROW;
+extern int register_printf_modifier (const wchar_t *__str) __THROW __wur;
 
 
 /* Register variable argument handler for user type.  The return value
    is to be used in ARGINFO functions to signal the use of the
    type.  */
-extern int register_printf_type (printf_va_arg_function __fct) __wur __THROW;
+extern int register_printf_type (printf_va_arg_function __fct) __THROW __wur;
 
 
 /* Parse FMT, and fill in N elements of ARGTYPES with the