On 07/01/2018 03:19 PM, Mahmood Naderan via gcc wrote:

> Is there any builtin function in C which prints the virtual address
> of functions including the main? I see __builtin_return_address()
> but that returns the “return address”.

#include <stdio.h>
int main() {
  printf("%p\n", main);
}

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

Reply via email to