Ekstatische Lyriken Pinnwand

error: taking address of expression of type ‘void’ [-Werror]

written by Pj on Thursday November 29th, 2012 -- 4:44 p.m.

edit this message - return to message index
(only moderators may edit messages)
What the fuck is wrong with people that they have nothing better to do than to sit around and think about how the compiler can be even more of a pain in the ass than it already is?

I have some binary data in an object file that's linked with my executable.  In the C files I declare it as such:

extern void data_whatever;
extern int size_whatever;

Then I pass this along to the function that needs it like this:

function(&data_whatever, size_whatever);

It used to work just fine, but some douche has decided that even though we know the address of the object, we aren't allowed to use that address for anything just because we don't know what the data type is.

It doesn't fucking matter what the data type is.  Indeed, there may be no data there at all if the size is zero, in which case declaring it as a "char" would create a variable that is just a memory access error if it is ever used.

Apparently "void" is like BASIC's "goto," the tool which is useful from time to time but which certain people who apparently don't code very much have decided "well I never use it and so neither should you."

I should really look into switching to clang sometime.

Replies

return to message index

Your Reply

Name: No registration necessary. Simply choose
a name and password and type them in.
Password:
Subject:
You may want to read the rules before you spend a lot of time writing something.
Message:
Plain Text - What you type is what you will see.
Some HTML - Use this if you are including HTML tags.
Pure HTML - Copies your post directly into the web page.
first, then