Source-Changes-D archive

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

Re: CVS commit: src/sys/sys



On Aug 10,  5:27pm, tron%NetBSD.org@localhost (Matthias Scheler) wrote:
-- Subject: Re: CVS commit: src/sys/sys

| On Sun, Aug 09, 2009 at 09:20:02PM +0000, Christos Zoulas wrote:
| > In article <20090809210918.GC22320%drowsy.duskware.de@localhost>,
| > Martin Husemann  <martin%duskware.de@localhost> wrote:
| > >On Sun, Aug 09, 2009 at 09:29:50PM +0200, Tonnerre LOMBARD wrote:
| > >> Unfortunately, these are widely used headers. We don't want to break
| > >> -Wold-style-casts in general.
| > >
| > >Why not?
| > >
| > >It is IMHO a very useless and stupid warning.
| > 
| > The new style casts are very useful because they show programming intent.
| 
| Can't we instead do what Solaris does?
| 
| #ifdef  __cplusplus
| extern "C" {
| #endif
| 
| [...]
| #define __byte_swap_u64_constant(x) \
|         ((uint64_t) \
| [...]
| 
| #ifdef  __cplusplus
| }
| #endif
| 
| That should allows us to keep the old-casts and avoid warnings.

This cannot possibly work because the syntax parsing happens after the macro
is expanded and the macro is expanded in c++ code.

christos


Home | Main Index | Thread Index | Old Index