473,396 Members | 1,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

System/ Compiler specific macros

Hello All,

For one of my applications I need to know what are all the predefined
system/ compiler specific macros are. All these days I used to use "-v"
or "-#" as a compiler option to figure out the required information.
But recently GCC 3.4.* compilers have stopped throwing out this piece
of information.

Is there any way I can write a piece of C program (or may be any other
way) and figure out all the system and compiler specific predefined
macros?

Thanks
-Vallabha

Nov 15 '05 #1
6 1941
vs*********@gmail.com wrote:
For one of my applications I need to know what are all the predefined
system/ compiler specific macros are. All these days I used to use "-v"
or "-#" as a compiler option to figure out the required information.
But recently GCC 3.4.* compilers have stopped throwing out this piece
of information.

Is there any way I can write a piece of C program (or may be any other
way) and figure out all the system and compiler specific predefined
macros?


I can't imagine you'll find a portable solution.

If your compiler is gcc, then http://gcc.gnu.org/lists.html

man gcc and grep for dCHARS. Might be what you want. Or not.
Nov 15 '05 #2
vs*********@gmail.com wrote:
Hello All,

For one of my applications I need to know what are all the predefined
system/ compiler specific macros are. All these days I used to use "-v"
or "-#" as a compiler option to figure out the required information.
But recently GCC 3.4.* compilers have stopped throwing out this piece
of information.

Is there any way I can write a piece of C program (or may be any other
way) and figure out all the system and compiler specific predefined
macros?


This cannot portably be done, why do you think you need to do this?

As far as gcc goes, from the documentation:

"Assuming you have no file foo.h, the command
touch foo.h; cpp -dM foo.h
will show all the predefined macros."

Robert Gamble

Nov 15 '05 #3
vs*********@gmail.com wrote:
Hello All,

For one of my applications I need to know what are all the predefined
system/ compiler specific macros are. All these days I used to use "-v"
or "-#" as a compiler option to figure out the required information.
But recently GCC 3.4.* compilers have stopped throwing out this piece
of information.

Is there any way I can write a piece of C program (or may be any other
way) and figure out all the system and compiler specific predefined
macros?


This cannot portably be done, why do you think you need to do this?

As far as gcc goes, from the documentation:

"Assuming you have no file foo.h, the command
touch foo.h; cpp -dM foo.h
will show all the predefined macros."

Robert Gamble

Nov 15 '05 #4
Robert Gamble wrote:
vs*********@gmail.com wrote:

For one of my applications I need to know what are all the
predefined system/ compiler specific macros are. All these days
I used to use "-v" or "-#" as a compiler option to figure out
the required information. But recently GCC 3.4.* compilers have
stopped throwing out this piece of information.

Is there any way I can write a piece of C program (or may be
any way) and figure out all the system and compiler specific
macros?


This cannot portably be done, why do you think you need to do this?

As far as gcc goes, from the documentation:

"Assuming you have no file foo.h, the command
touch foo.h; cpp -dM foo.h
will show all the predefined macros."


The options used will affect that result. For ex. on my system:

[1] c:\c\junk>cpp -dM -W -Wall -ansi -pedantic empty.c
#define __HAVE_BUILTIN_SETJMP__ 1
#define __unix__ 1
#define __i386__ 1
#define __SIZE_TYPE__ long unsigned int
#define __DJGPP 2
#define __USER_LABEL_PREFIX__ _
#define __tune_pentium__ 1
#define __STDC_HOSTED__ 1
#define __MSDOS__ 1
#define DJGPP 2
#define __WCHAR_TYPE__ short unsigned int
#define __DJGPP__ 2
#define __WINT_TYPE__ int
#define __tune_i586__ 1
#define __DJGPP_MINOR__ 3
#define __STRICT_ANSI__ 1
#define __GO32__ 1
#define DJGPP_MINOR 3
#define __STDC__ 1
#define __PTRDIFF_TYPE__ int
#define __DJGPP_MINOR 3
#define __REGISTER_PREFIX__
#define __NO_INLINE__ 1
#define __i386 1
#define __VERSION__ "3.2.1"

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
Nov 15 '05 #5
In article <11**********************@g49g2000cwa.googlegroups .com>,
Robert Gamble <rg*******@gmail.com> wrote:
vs*********@gmail.com wrote:
Hello All,

For one of my applications I need to know what are all the predefined
system/ compiler specific macros are. All these days I used to use "-v"
or "-#" as a compiler option to figure out the required information.
But recently GCC 3.4.* compilers have stopped throwing out this piece
of information.

Is there any way I can write a piece of C program (or may be any other
way) and figure out all the system and compiler specific predefined
macros?


This cannot portably be done, why do you think you need to do this?

As far as gcc goes, from the documentation:

"Assuming you have no file foo.h, the command
touch foo.h; cpp -dM foo.h
will show all the predefined macros."


I think this can be simplified to: cpp -dM /dev/null

Nov 15 '05 #6
In article <da**********@yin.interaccess.com>,
Kenny McCormack <ga*****@interaccess.com> wrote:


In article <11**********************@g49g2000cwa.googlegroups .com>,
Robert Gamble <rg*******@gmail.com> wrote:

As far as gcc goes, from the documentation:

"Assuming you have no file foo.h, the command
touch foo.h; cpp -dM foo.h
will show all the predefined macros."


I think this can be simplified to: cpp -dM /dev/null


On unix-like platforms.
--
7842++
Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Carl Ribbegaardh | last post by:
Is there any known list of compiler identification macros? I'm using VS 2003, g++ on windows, sun's cc and g++ on solaris. Is it possible to identify the compiler using macros? I'm aware of WIN32...
27
by: Kevin A | last post by:
Hi, Is there a way to determine the name and version of the operating system in a portable way? (for Solaris/Linux) Thanks, Kevin
10
by: Vavel | last post by:
Hi all! I want to insert the record into the table by using an application program that includes the following statements: EXEC SQL BEGIN DECLARE SECTION; long hvInt_Stor; long hvExt_Stor;...
4
by: The Spoon | last post by:
I am looking for functions that can be used to automatically update the system date and time on an NT based system, resulting from manually entered date and time values input by an operator via a...
233
by: E. Robert Tisdale | last post by:
I have access to a wide variety of different platforms here at JPL and they all have pretty good C 99 compilers. Some people claim that they have not moved to the new standard because of the...
18
by: smnoff | last post by:
Ok, I am think I am a little more knowledgeable about C and pointers, ughh. And likewise, I want to fix C.....and not so much to make a C++ or Java or C# or even D like language. So, if I...
5
by: pt | last post by:
Hi, i am wonderng what is faster according to accessing speed to read these data structure from the disk in c/c++ including alignment handling if we access it on little endian system 32 bits...
11
by: Charles Sullivan | last post by:
I have a number of functions, e.g.: int funct1( int arg1, int arg2, int arg3 ); int funct2( int arg1, int arg2, int arg3 ); int funct3( int arg1, int arg2, int arg3 ); that are called via...
6
by: toton | last post by:
Hi, Anyone have a link to comparative study of different C++ compilers and how much they conform to C++ language standard? Most of the big platforms I know have GCC which well supports C++...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.