This is the mail archive of the gcc-patches@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]

Re: fix of small typo


Jeffrey A Law <law@hurl.cygnus.com> said:
>   In message <199812032058.RAA21785@pincoya.inf.utfsm.cl>you write:
>   > mrs@wrs.com (Mike Stump) said:

>   > [...]

>   > >   #define ASM_FILE_START(FILE) \
>   > > !   do {	output_file_directive (FILE, main_input_filename);	\
>   > >     } while (0)

>   > Can't the do{ .. }while(0) be removed here?
> I don't recommend removing them.

> The do { ... } while (0) constructs make maintenance significantly easier.
> 
> Such constructs are much more tolerant of being used in if/else arms
> safely for example.

That is certainly true, but it is (or should be?) superfluous in this
particular case. I for one prefer to have to simplest, cleanest code
possible at all times. If not, somebody _will_ start wondering someday what
is missing inside the do { ... } while(0).

Just different styles to program, I guess. Not even a small deal ;-)
-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513



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