[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] placement of const is _not_ a matter of style ...

From: Mike Bianchi
Subject: [groff] placement of const is _not_ a matter of style ...
Date: Sat, 5 May 2018 12:18:26 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

The placement of  const  is _not_ a matter of style!

>> For example,
>> in C code, it is very common to see:
>>   const char *foo;
>> which means something very different from:
>>   char const *foo;
> Actually, it doesn't.  Try it.

Actually it does.

        char *foo const;
Also means something!


To my mind this confusion points to a weakness of C and C++.
It would be much less of an issue if I could ask a compiler.

        What is the type of  foo ?
to be certain excacty what I was dealing with when referencing  foo .
((Or is there something out there I am not aware of?))
((Where is Dennis Ritchie when you need him?  RIP))

GCC has a  typeof  keyword, but that _duplicates_ a type.

 Mike Bianchi
 Foveal Systems

 973 822-2085


reply via email to

[Prev in Thread] Current Thread [Next in Thread]