Re:Why 1 && 2 == 2
by cldr on Thursday July 18, 2013 @11:53PM
(#6068238)
Not putting a format specifier wouldn't cause a segfault.
[ Parent
| on HN ]
[deleted]
Well, there is a difference between "format specifier" and "format string". The first argument to printf is the format string, the `%d` and `%s` type things are the format specifiers. I was talking about this
printf("Hi", 45);
which will not segfault. If you meant printf(45);
Then you are absolutely correct, that would segfault on common machines.I think that must be it. And it makes perfect sense how he would hit it. Example: http://ideone.com/MilaUN
Deleted my comment because you are, of course, correct. (However, I do suspect rayiner was referring to omitting the format string.)