[Python-Dev] Compiler warnings (original) (raw)

"Martin v. Löwis" martin at v.loewis.de
Wed Feb 1 08:20:21 CET 2006


Guido van Rossum wrote:

Well, that's pretty bizarre. There's obviously no way to get to a reference to e without going through

x = PyLongAsScaledDouble(vv, &e); first. That isn't a useful warning. But how can the compiler know that it is an output-only argument?

If a variable's address is passed to a function, gcc normally assumes that the function will modify the variable, so you normally don't see "might be used uninitialized" warnings. However, gcc now also inlines the functions called if possible, to find out how the pointer is used inside the function.

Changing the order of the functions in the file won't help anymore, either. If you want to suppress inlining, you must put

attribute((noinline))

before the function.

Regards, Martin



More information about the Python-Dev mailing list