"warning: suggest parentheses around assignment used as truth value"

Add comments

ふつうのLinuxプログラミング Linuxの仕組みから学べるgccプログラミングの王道

ふつうのLinuxプログラミング Linuxの仕組みから学べるgccプログラミングの王道』の198ページのコードで出た警告。gccには”-Wall”オプションを付けてます。以前にも遭遇した警告なのに忘れていたので、メモしておこう。

while (ent = readdir(d)) {

while ((ent = readdir(d))) {

に修正。

while ((ent = readdir(d)) != NULL) {

でも同じ?

One Response to “"warning: suggest parentheses around assignment used as truth value"”

  1. Hurry Says:

    Cheap Generic and Brand Drugs Online Pharmacy - Top Medicine Shop! Buy Cheap Generic Pills Now. WorldWide Shipping

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS ログイン