From: Kevin Bailey <ke-gcc@retriever.dyndns.org>
To: gcc-help@gcc.gnu.org
Subject: Re: Use of typeof
Date: Sat, 02 Mar 2002 11:04:00 -0000 [thread overview]
Message-ID: <20020302110414.S28462@hawk.ind.alcatel.com> (raw)
In-Reply-To: <200203011601.g21G1Ic19355@PCIgeomatics.com>; from cheng@PCIgeomatics.com on Fri, Mar 01, 2002 at 11:01:18AM -0500
There is no such thing as typeof in C.
However, there is in C++ so either rename your file to test.cc
or compile with -xc++.
On Fri, Mar 01, 2002 at 11:01:18AM -0500, Philip Cheng wrote:
> 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");
> }
next prev parent reply other threads:[~2002-03-02 19:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-03-01 8:03 Philip Cheng
2002-03-02 11:04 ` Kevin Bailey [this message]
2002-03-02 13:43 ` Kevin Bailey
2002-03-04 6:36 ` Philip Cheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20020302110414.S28462@hawk.ind.alcatel.com \
--to=ke-gcc@retriever.dyndns.org \
--cc=gcc-help@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).