Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use __extension__ and __typeof__ in a minified example in C?

Tags:

c

token

I saw there are such tokens in gcc's source code,

but how to use these 2 tokens?

like image 978
assem Avatar asked Mar 16 '11 09:03

assem


1 Answers

__extension__:

GCC uses the __extension__ attribute when using the -ansi flag to avoid warnings in headers with GCC extensions. This is mostly used in glibc with function declartions using long long

__typeof__:

MIN and MAX in C is a good example how it's used. Basically it allows you to declare a variable which has the same type as another variable.

like image 160
ThiefMaster Avatar answered Oct 17 '22 07:10

ThiefMaster