Zoltán Kócsi <zol...@bendor.com.au> writes: > However: > > int (*bar( void ))( unsigned ) > { > return __builtin_popcount; > } > > returns the address of the label "__builtin_popcount", which does not exist: > > int main( int arcg, char *argv[] ) > { > (void) argv; > return (*bar())( argc ); > } > > fails to compile because of an undefined reference to __builtin_popcount.
... > I believe that the above is an issue, but I don't know if it is bug or a > feature, i.e. a compiler or a documentation issue? It's a documentation issue, and also a compiler issue in that the compiler should give an error for this. __builtin_popcount will compile to the popcnt instruction on x86_64 if you use -march=corei7-avx. Ian