Skip to content

Instantly share code, notes, and snippets.

@thekvs
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save thekvs/0d2d3f6b112072ef0c04 to your computer and use it in GitHub Desktop.

Select an option

Save thekvs/0d2d3f6b112072ef0c04 to your computer and use it in GitHub Desktop.
kvs@lair tmp:> cat t.c
#include <stdio.h>
int
main()
{
char *p = "aaa";
if (p = NULL) {
printf("WHAT?\n");
}
return 0;
}
kvs@lair tmp:> gcc -Wall t.c -o t
t.c: In functionmain’:
t.c:8:5: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
if (p = NULL) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment