From 2993493134588770372
X-Google-Thread: 7894ca11fe,661f9f6c1b45f277,start
X-Google-Attributes: gid7894ca11fe,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news1.google.com!news2.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: Tue, 13 Apr 2010 18:00:08 -0500
Return-Path: <cppmods@ruralroute.cs.rpi.edu>
To: (Usenet)
From: Olaf Krzikalla <krzikalla@gmx.de>
Newsgroups: comp.std.c++
Subject: Two thoughts about attributes in the FCD
Organization: albasani.net
Sender: cppmods@cs.rpi.edu
Approved: austern@google.com
Message-ID: <hq1aa6$nad$1@news.albasani.net>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
X-Original-Date: Tue, 13 Apr 2010 10:35:20 +0200
X-Submission-Address: std-c++@netlab.cs.rpi.edu<std-c%2B%2B@netlab.cs.rpi.e=
	du>
Date: Tue, 13 Apr 2010 17:54:36 CST
Lines: 53
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-CBlVPJXgoiBicf4DtID3yu6GtHiXXvwADTQl7l2frPvH3Z9C436MQnlM++Y6HuSu950lI+S+OBCFepV!f5VBSflNFdUpNsn7Zuf9ldWhJNTS4T8X71VHayL/v3WNzXRCUoELEk9D
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: g2news1.google.com comp.std.c++:2424

Hi,

I have two issues regarding attributes:

1. The syntax does not allow the chaining of attribute-specifiers. That is,
you can write:

[[attribute1, attribute2]] for (;;) {}

but you can't write:

[[attribute1]] [[attribute2]] for (;;) {}

IMHO the second version should be allowed too and it should be semantically
equal to the first one. This allows for easier creation of
implementation-dependent constructs as follows:

#ifdef NEW_CPP
#define parfor [[some_parallel]] for
#else
#define parfor for
#endif

#ifdef EVEN_NEWER_CPP
#define parfor_aligned [[align(4)]] parfor
#else
#define parfor_aligned parfor
#endif

With the current syntax it would be difficult to define parfor_aligned on
top of parfor while keeping parfor indepedendent from parfor_aligned.


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.


Best regrads
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<std-c%2B%2B@netlab.cs.rpi.edu>
]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]



