concatenation of string literals

Joseph S. Myers jsm28@cam.ac.uk
Sat Apr 19 07:33:00 GMT 2003


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@cam.ac.uk



More information about the Gcc mailing list