:: Re: [DNG] What is the meaning of th…
Top Pagina
Delete this message
Reply to this message
Auteur: Arnt Gulbrandsen
Datum:  
Aan: dng
Onderwerp: Re: [DNG] What is the meaning of this gcc warning?
Edward Bartolo writes:
> Could someone explain to me what is the meaning of this error and what
> I should do to avoid having this warning?


Take this code:

   if(a = copes_done())
       log("Copies completed: %d", a)l


See what it does? The log line is only emitted when a is not zero. Useful,
isn't it? But mostly, if(a=foo()) is a mistyped if(a==foo()), so gcc
suggests that you add an extra () to clarify that you didn't just forget a
= sign.

Arnt