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

Fucking GCC warnings

Name: Anonymous 2010-11-12 13:54

request for implicit conversion from ‘void *’ to ‘struct keys *’ not permitted in C++

keys = mmap(0, sizeof(struct keys), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);

First: C99 code (-x c -std=c99).
Second: what is going on?

Name: Anonymous 2010-11-13 5:12

Eleven replies and no one has fixed the OPs problem yet. The collective skill of /prog/ truly has degraded to a dismal and disappointing low point. You should all be ashamed.

>>4 got pretty close, but he was casting to the struct type, not the pointer to struct type required (mmap returns void*).


keys = (struct keys *)mmap(0, sizeof(struct keys), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);


It doesn't matter if it's C or C++ here, you have to do that cast, especially if you compile with default or elevated warnings in GCC like you should be.

Don't fault the compiler or language for your own stupidity.

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