From 8892520604976185995
X-Google-Thread: 7894ca11fe,661f9f6c1b45f277
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news1.google.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Fri, 30 Apr 2010 15:30:11 -0500
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
To: (Usenet)
From: Olaf Krzikalla <krzikalla@gmx.de>
Newsgroups: comp.std.c++
Subject: Re: Two thoughts about attributes in the FCD
Organization: albasani.net
Sender: cppmods@cs.rpi.edu
Approved: james.dennett@gmail.com
Message-ID: <hre42h$iih$1@news.albasani.net>
References: <hq1aa6$nad$1@news.albasani.net>
	<hr68k7$752$1@news.albasani.net>
	<83rbioFejhU1@mid.individual.net>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
X-Original-Date: Fri, 30 Apr 2010 10:23:58 +0200
X-Submission-Address: std-c++@netlab.cs.rpi.edu
Date: Fri, 30 Apr 2010 15:24:08 CST
Lines: 47
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-w5hh0SqoErOevxaMZ+E6NnpDpWtnwTOPIzHg18UWBj9cGb28ujeVyL4ti0BBF6wjlImu0clxPhZnQ4o!B/memh12bUkzSPZyO/PN2sG9ZL0I9iCZkCc4Nkz6Kk0pI/3HPCKuU2lz
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
Xref: g2news2.google.com comp.std.c++:2488

Bo Persson schrieb:
>>
>> Olaf Krzikalla schrieb:
>>
>>> 2. =A77.6.1.5 states, that attibute tokens not being specified
>>> behave implementation-defined. Shouldn't we restrict this in a
>>> way, that attibutes unknown to an particular implementation shall
>>> be ignored. Like: an implementation is not allowed to refuse
>>> compilation only because a syntactically correct attribute-token
>>> is unknown. Maybe someone can rephrase this to standard speak.
>>>
>> During a discussion about adding attributes to clang I noticed that
>> section 7.6.1.5 as written IMHO opens a can of worms. If everybody
>> is
>> allowed to add arbitrary attributes then we can't extend the set of
>> predefined attributes in the future without the danger of breaking
>> standard-conform code. Thus I would propose that the use of
>> attributes in the global and std attribute-namespace cause
>> undefined behavior unless they are defined in the standard. This
>> keeps the freedom to standardize more attributes in the future. For
>> attributes in other namespaces the behavior is still implementation
>> defined. But as I wrote in my previous post, we should add the
>> sentence:
>> "Any attribute (not in the global and std attribute-namespace) that
>> is not recognized by the implementation is ignored."
>>
>
> Including misspelled attributes? Could introduce interesting new bugs!

For unknown attributes in the global and std namespace we can change
from ub to ill-formed. Thus the issue exists (if at all) for
implementation specific attributes only - as it does for pragmas.
The attribute namespace makes things even better, since an
implmentation can simply define, that any attribute in a particular
namespace is recognized (and in case it is misspelled makes the
program ill-formed).
By all means I consider sec. 7.6.1.5 underspecified.

Best regards
Olaf Krzikalla

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



