This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: concatenation of string literals


On Fri, 18 Apr 2003, Matt Kraai wrote:

> - K+R C compilers did not have a void pointer, and used char * as the
> - pointer to anything.  The macro PTR is defined as either void * or
> - char * depending on whether you have a standards compliant compiler or
> - a K+R one.  Thus
> - 
> -   free ((void *) h->value.expansion);
> - 
> - should be written
> - 
> -   free ((PTR) h->value.expansion);

I suppose uses of both PTR and such casts as these should be removed from
the code.

> - Variable-argument functions are best described by example:-

Likewise, these can be converted to simply using ISO C <stdarg.h>.

(Perhaps there should be a list of obsolete coding practices to look out
for in ISO C conversion?)

> - Trigraphs
> - ---------
> - 
> - You weren't going to use them anyway, but trigraphs were not defined
> - in K+R C, and some otherwise ISO C compliant compilers do not accept
> - them.

The comment that trigraphs must not be used is still relevant.

-- 
Joseph S. Myers
jsm28 at cam dot ac dot uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]