This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Use of typeof


I would like to use typeof to determine the type of a variable.  
However, I keep getting the error when I try to compile the program.

  test.c: In function `main':
  test.c:8: parse error before "typeof"

Anyone knows how can I solve the problem?  Thanks in advance for your help.

Philip


Here is my test program:

#include <stdio.h>

main()
{
        double  dftest;
        dftest = 1.0;

        if (__builtin_types_compatible_p (typeof (dftest), double)) 
            printf("It is double\n");
} 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]