[issue18090] dict_contains first argument declared register, and shouldn't be

Stefan Krah report at bugs.python.org
Thu May 30 20:03:34 CEST 2013


Stefan Krah added the comment:

+1 for removing all occurrences of "register".


Regarding the grammar, we have:

function-definition:
    declaration-specifiers-opt declarator declaration-list-opt compound-statement


So I think that "part of an external declaration" refers to the outermost
declaration-specifiers, not to some inner declaration-specifiers that are
part of the parameter-type-list. Otherwise it would also be forbidden to
use "register" in the compound-statement. ;)

Thus, IMO this is legal:

   a) int f (register int x) {return x;}


But this is not allowed:

   b) register int f (int x) {return x;}


As Mark said, a) does not alter the calling convention. It's just a request
to keep x in a register in the function body once the parameter passing is
done.

----------
nosy: +skrah

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18090>
_______________________________________


More information about the Python-bugs-list mailing list