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-26 22:11

>>24
you're a moron. you're talking as if the only possible differences between a <T> template and its <const T> specialization are, well, that every time a T is used in the original template, the same code is replicated in the <const T> specialization but just with a "const" in front of all Ts. tell me, how does this fantasy language of yours deal with a conversion between somethings, e.g.
something<const int> a = something<int>();
does it convert the int a to double a? what if I called it double b, would the compiler magically still link int a to it?

understand that your suggestion is also tantamount to saying we should implicitly allow stuff like
something<double> a = something<int>();
y'know, I mean, I can do double f = 3;, so why can't my templates implicitly convert between these types as well.

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