473,386 Members | 1,830 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,386 software developers and data experts.

Compiler switches in the source code

Hi there,
In the old Pascal-times, you could set compiler switches in the source code,
with a syntax like {$G+}, things like that (I don't remember them accurately
anymore).
Is there something similar with C++ compilers, e.g. to set the /GX switch
(unwind semantics for exception handling) on and off? This is what I mean if
it is still not clear:
// {GX+}
void funcWithExcHandling() {...}
// {GX-}
void funcWithoutExcHandling() {...}

Yeah, and one more question: Is there a newsgroup specifically for MS Visual
C++ compilers?

Thx,
Guszti
Jul 19 '05 #1
2 5297
"Ágoston Bejó" <gu***@inf.elte.hu> wrote...
Hi there,
In the old Pascal-times, you could set compiler switches in the source code, with a syntax like {$G+}, things like that (I don't remember them accurately anymore).
Is there something similar with C++ compilers, e.g. to set the /GX switch
(unwind semantics for exception handling) on and off? This is what I mean if it is still not clear:
// {GX+}
void funcWithExcHandling() {...}
// {GX-}
void funcWithoutExcHandling() {...}
If there is, it's compiler-specific.
Yeah, and one more question: Is there a newsgroup specifically for MS Visual C++ compilers?


microsoft.public.vc.*
Jul 19 '05 #2
Ágoston Bejó wrote:
Hi there,
In the old Pascal-times, you could set compiler switches in the source code,
with a syntax like {$G+}, things like that (I don't remember them accurately
anymore).
Is there something similar with C++ compilers, e.g. to set the /GX switch
(unwind semantics for exception handling) on and off? This is what I mean if
it is still not clear:
// {GX+}
void funcWithExcHandling() {...}
// {GX-}
void funcWithoutExcHandling() {...}
In C++, they are called "pragmas". The usage is:
#pragma {compiler specific directive}

Note that there are no standard arguments to #pragma directives. These
preprocessing directives are meant as a tool to pass information to the
compiler. Also, the arguments of a #pragma may have one meaning to
one compiler, and a whole different meaning to another.

If the compiler doesn't understand the #pragma arguments, the directive
is ignored.


Yeah, and one more question: Is there a newsgroup specifically for MS Visual
C++ compilers?
Yes. Read the C++ FAQ and Welcome.Txt below.

Thx,
Guszti

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 19 '05 #3

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

Similar topics

1
by: Adam | last post by:
I'm just starting to try and learn my first comp language. However, I'm so new to this I don't even know how to get the compiler to work that came with my Jamso's C++ book. I've read the readme...
13
by: Bryan Parkoff | last post by:
You may notice that switch (...) is much faster than function that can gain a big improved performance because it only use JMP instruction however function is required to use CALL, PUSH, and POP...
14
by: Hugh Cowan | last post by:
Hello, I am looking at getting a simple compiler for Windows that I can use to play around with different Open Source software. I am not a full-time programmer (anymore), nor do I plan to...
14
by: joshc | last post by:
I'm writing some C to be used in an embedded environment and the code needs to be optimized. I have a question about optimizing compilers in general. I'm using GCC for the workstation and Diab...
0
by: JD | last post by:
Hi folks, I am developing a COM-ATL application with VS2003.NET, and I run into this situation: I have built the app to a satisfactory point and after that I start playing with compiler...
44
by: Don Kim | last post by:
Ok, so I posted a rant earlier about the lack of marketing for C++/CLI, and it forked over into another rant about which was the faster compiler. Some said C# was just as fast as C++/CLI, whereas...
3
by: Konrad Hinsen | last post by:
I am trying to install Python 2.4.3 on an AMD Opteron system using the Portland Group's compiler (pgcc). Using CC="pgcc -DNCURSES_ENABLE_STDBOOL_H=0" OPT="-O0" LINKFORSHARED="-Wl,- ...
2
by: justmehere | last post by:
My understanding that this compiler is from the Borland Builder C++ 5.5 Compiler. Does anyone know where to find the complete reference for using regular expression with this compiler and the...
87
by: rufus | last post by:
Is there a C-compiler (and for that matter C++ compiler) for windows that can be run from the commmand line?
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.