Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 2
    Maybe so. My intent is not to prove any general case pattern, rather an observation about what gcc's philosophy on warning suppression seems to be. Commented Jul 31, 2010 at 20:12
  • compiler behaves differently w/r/t warnings with added parentheses?!?!??!!!! WOW! That is unexpected. Commented Dec 10, 2014 at 17:05
  • 2
    @JasonS the parens doesn't change the compiler's behavior wrt warnings, what it does is change the semantics of the statement. The extra parens make the compiler finish the assignment and keep its final value as an expression, which deserves no warning. If you want clarity, you could say if ((p=malloc(cnt)) != NULL) ... as that is what the compiler is doing behind the scenes. Commented Aug 9, 2018 at 18:10
  • 1
    @JesseChisholm: I don't think your explanation is accurate. Commented Nov 1, 2018 at 20:32
  • 1
    ICE = U.S. Immigration and Customs Enforcement Commented Nov 8, 2022 at 21:37