3 ms·
https://stackoverflow.com/questions/34519318/c-address-of-function-parameter https://stackoverflow.com/questions/34519318/c-address-of-fu... suggests it's guara
by ximeng 5y ago
https://stackoverflow.com/questions/34519318/c-address-of-function-parameter https://stackoverflow.com/questions/34519318/c-address-of-fu... suggests it's guaranteed by the standard to be OK.
In the standard at https://web.archive.org/web/20181230041359if_/http://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf https://web.archive.org/web/20181230041359if_/http://www.ope...
6.5.3.2 Address and indirection operators
Constraints
1 The operand of the unary & operator shall be either a
function designator, the result of a [] or unary
\* operator, or an lvalue that designates an object that
is not a bit-field and is not declared with the
register storage-class specifier.
So as the parameter is an lvalue it is guaranteed to work with the & operator.