Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

-std=c99 my anus

Name: Anonymous 2009-11-25 15:29

[code]$cat test.c
#include <stdlib.h>
#include <string.h>

int main(void) {
    char *foo;
    foo = strdup("bar");
    free(foo);
    return 0;
}
$gcc test.c
$gcc -std=c99 test.c
test.c: In function 'main':
test.c:6: warning: implicit declaration of function 'strdup'
test.c:6: warning: assignment makes pointer from integer without a cast[code]
What the heck is this, /prog/? Is there some shit around strdup() in c99?

Name: Anonymous 2009-11-30 23:16

>>46
An API function? No, I don't. My own function? Why would I be so stupid? My coworker's function? I'm not that kind of asshole.
Oh so you never modify code then! Or you're just never in a hurry, never under pressure to get things done. No deadlines I guess? No weekends or 2am nights for you, no sir, because you're the EXPERT /PROG/RAMMER

Well guess what, not all programmers are as awesome as you are. We don't often get to decide who our coworkers are, and like it or not, they do have to change our code sometimes.

No I don't. I know how to pass it happily without casting. Maybe it means I'm cleverer than you, but I think it just means I know C and you don't.
Well you're going to have to explain how you're doing this in a portable way.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List