Article View: fr.comp.lang.c
Article #15158Re: rot13 [Was : Re: conjugaison et autres ...]
From: Charlie Gordon
Date: Sat, 08 Oct 2005 09:56
Date: Sat, 08 Oct 2005 09:56
50 lines
2998 bytes
2998 bytes
"Harpo" <trashcan@hotmail.com> wrote in message
news:43475686$0$17226$8fcfb975@news.wanadoo.fr...
> Charlie Gordon wrote:
> > Ton truc ne marche pas : (return c) n'est pas une instruction
> > conforme.
>
> En effet mais j'ai bien dit 'un truc comme �a'.
> J'ai oubli� des copi� coll� d'une ligne au dessus.
> Corrigeons, j'ai compil�, j'avais notamment aussi oubli� les accolades :
>
> #ifdef DEBUG
> #ifdef __GNUC__
> #define xreturn( rc ) \
> ( { __typeof__(rc) RC = rc; \
> fprintf( stderr, "function %s return %lx\n", __func__, \
> (long)RC ); return RC ; \
> } )
> #else
> #define xreturn( rc ) \
> return rc
> #endif // __GNUC__
> #else
> #define xreturn( rc ) \
> return rc
> #endif // DEBUG
Oui, ils ne redefinissent pas return, mais une macro xreturn avec parametre.
Je maintiens donc que les parentheses sont nuisibles dans la plupart des
instructions return :
return NULL; et non return( NULL );
> > et la version de DEBUG ne marche pas pour des cas simples
> > comme:
> >
> > return ((int)value);
> >
> > ou
> >
> > return ((a + b) * c);
>
> Ah bon ? Et pourquoi donc ?
Parce que certains pr�processeurs vont expanser return recursivement : return
(int)value et return (a+b) * c .
Et tous les preprocesseurs le feront si tu ne rajoutes pas systematiquement des
parentheses partout, en particulier dans du code import�...
--
Charlie
Technical Details
Message-ID:
<4347976d$0$16540$626a14ce@news.free.fr>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!infeed-2.proxad.net!news18-e.free.fr!not-for-mailReferences:
<1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr> <43403203$0$5388$8fcfb975@news.wanadoo.fr> <43403d27$0$306$7a628cd7@news.club-internet.fr> <4340cabe$0$27448$8fcfb975@news.wanadoo.fr> <43438f4d$0$21032$636a55ce@news.free.fr> <434433fa$0$5374$8fcfb975@news.wanadoo.fr> <43468180$0$20850$636a55ce@news.free.fr> <43475686$0$17226$8fcfb975@news.wanadoo.fr>Show Full Headers
Complete Article Headers
X-Google-Thread: f9822,b21b26167a936e28 X-Google-Attributes: gidf9822,public X-Google-Language: FRENCH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!proxad.net!infeed-2.proxad.net!news18-e.free.fr!not-for-mail From: "Charlie Gordon" <news@chqrlie.org> Newsgroups: fr.comp.lang.c References: <1126342327.583568.21420@g43g2000cwa.googlegroups.com> <4329e5d4$0$7846$8fcfb975@news.wanadoo.fr> <dge4b6$fqa$1@reader1.imaginet.fr> <432ab809$0$1734$8fcfb975@news.wanadoo.fr> <mn.84b07d59016a857b.31483@laposte.net> <433f16ac$0$27406$8fcfb975@news.wanadoo.fr> <mn.10907d5a55119e84.15512@YOURBRAnoos.fr> <433f9cb1$0$7821$8fcfb975@news.wanadoo.fr> <mn.128c7d5aa5238de0.15512@YOURBRAnoos.fr> <43403203$0$5388$8fcfb975@news.wanadoo.fr> <43403d27$0$306$7a628cd7@news.club-internet.fr> <4340cabe$0$27448$8fcfb975@news.wanadoo.fr> <43438f4d$0$21032$636a55ce@news.free.fr> <434433fa$0$5374$8fcfb975@news.wanadoo.fr> <43468180$0$20850$636a55ce@news.free.fr> <43475686$0$17226$8fcfb975@news.wanadoo.fr> Subject: Re: rot13 [Was : Re: conjugaison et autres ...] Date: Sat, 8 Oct 2005 11:56:42 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 Lines: 52 Message-ID: <4347976d$0$16540$626a14ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 08 Oct 2005 11:54:53 MEST NNTP-Posting-Host: 81.57.219.236 X-Trace: 1128765293 news18-e.free.fr 16540 81.57.219.236:37571 X-Complaints-To: abuse@proxad.net