[Developers] C99

Erik Schnetter schnetter at cct.lsu.edu
Fri Sep 22 10:07:11 CDT 2006


On Sep 22, 2006, at 09:59:51, Tom Goodale wrote:

> On Fri, 22 Sep 2006, Erik Schnetter wrote:
>
>> On Sep 22, 2006, at 06:49:54, Frank Loeffler wrote:
>>
>>> Hi,
>>>
>>>> On 21.09.06, Frank Loeffler wrote:
>>>>> Is there a way of telling Cactus to use the C99 standard? Or  
>>>>> even better
>>>>> - could we by default enable it, if it is available for a  
>>>>> compiler?
>>>
>>> Steve White wrote:
>>>> If the compile fails, you tell the user
>>>> what to do about it.
>>>
>>> That was exacly my point - what should the user do about it?
>>> He could dig through the documentation of his compiler and change  
>>> his
>>> compiler options by hand.
>>> However, it would be nicer to have something like a configuration  
>>> option
>>> 'C99="yes"' for Cactus to use C99, maybe even turned on by  
>>> default. Then
>>> a thorn can check for that and give a suitable error message like
>>> 'Please set C99 to "yes" in your configuration to use this thorn.'
>>
>> This sounds overly complicated.  Cactus knows, for each compiler  
>> on each
>> architecture, a set of default flags that it uses.  You can add  
>> the C99 flags
>> to these.  (Of course, you need to make sure things don't break etc.)
>>
>> The largest problem is finding out these flags for each compiler.   
>> For
>> example, gcc has a "std=c99" flag, but you don't want to use that;  
>> instead,
>> you want to use "std=gnu99".
>>
>> The scripts handling this are in lib/make/known-architectures.   
>> Have a look,
>> add the C99 flags for your favourite compilers, and submit a patch.
>>
>> I'm all for this change.
>
> I think the C99=yes may be better, as we can't guarantee C99  
> everywhere so
> it would be good if it was a conscious decision to use C99 features.

We could have CC and C99, as we have F77 and F90...

Is anybody aware of a compiler which does not support C99?  There are  
probably many compilers which don't support all of C99, but every  
compiler I know supports the "usual" stuff, such as // comments and  
interspersed variable declarations.

-erik

-- 
Erik Schnetter <schnetter at cct.lsu.edu>

My email is as private as my paper mail.  I therefore support encrypting
and signing email messages.  Get my PGP key from www.keyserver.net.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://www.cactuscode.org/pipermail/developers/attachments/20060922/aa5792b3/attachment.bin 


More information about the Developers mailing list