:: Re: [DNG] What is the meaning of th…
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Arnt Gulbrandsen
日付:  
To: dng
題目: 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