473,503 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Preprocessor/Compiler question

ibm
Is there a preprocessor directive or other means whereby you can get
the
compiler ( for some reasonable set of compilers ) to print a user
defined comment then continue at compile time when it reaches a given
point in the source.

#error will stop and print its location but I want to continue.

Doing something like inserting "#pragma pack(show)" at the point in
question produces the required result but as a warning.
I'd like not to have warnings if at all possible.

My application can take some time to compile and I'd like the users to
have some sense ( its an engineering tool rather than a consumer app )
of what is happening when they specify large and time consuming data
sets.
That way they won't be tempted to muck with normal processing.

I'm going to put a large type explicit warning about this in the FM.
But that, I'm afraid depends on the user actually RTFM.

Something on the lines of:

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVV
ADVICE: You have specified a large data set. <<<<<
ADVICE: This may take a while ( up to 5 minutes ) <<<<<
ADVICE: Go get some coffee and relax <<<<<

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^

Well, thats a little overboard but you get the idea...
IBM

Jul 23 '05 #1
3 1598
ib*@svpal.org wrote:
Is there a preprocessor directive or other means whereby you can get
the
compiler ( for some reasonable set of compilers ) to print a user
defined comment then continue at compile time when it reaches a given
point in the source.
[...]


Nothing in the standard language. Some compilers do implement
#pragma message
but that's compiler-specific, ask in a newsgroup for that compiler.

V
Jul 23 '05 #2

<ib*@svpal.org> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Is there a preprocessor directive or other means whereby you can get
the
compiler ( for some reasonable set of compilers ) to print a user
defined comment then continue at compile time when it reaches a given
point in the source.


I think this is what you're looking for:

www.digitalmars.com/ctg/pragmas.html#message

www.digitalmars.com free C, C++, D compilers
Jul 23 '05 #3
ibm
#pragma message("say what you mean" [__MACRO__] )

Turns out its an ANSI thing.
Don't know how I managed to miss that unless it was trying ( as usual )
to do too many htings at once.

IBM

Jul 23 '05 #4

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

Similar topics

13
2088
by: Chris Croughton | last post by:
Is the following code standard-compliant, and if so what should it do? And where in the standard defines the behaviour? #include <stdio.h> #define DEF defined XXX int main(void) { int...
9
3640
by: Walter Roberson | last post by:
I have run into a peculiarity with SGI's C compiler (7.3.1.2m). I have been reading carefully over the ANSI X3.159-1989 specification, but I cannot seem to find a justification for the behaviour....
5
3048
by: Water Cooler v2 | last post by:
Sorry if this is a foolish question, but here it is. I see things like #ifndef STDC ...blah #endif #ifdef WIN32
3
2008
by: Avin Patel | last post by:
Hi, I have written C# code. And I have used preprocessor / macro in it. I want to get the C# code after processing preprocessor, I have defined durcng compile time. How can I get this code? ...
2
1065
by: Ben Taylor | last post by:
Hi, I know that when I use #define statements, the preprocessor goes and replaces instances of where I have used the definitions with what they are defined as, but my question today is does it...
2
2785
by: Christopher Ireland | last post by:
Hello, I'm looking for a C# Preprocessor (shareware with source, if possible) which has the functionality of preprocessors which already exist in other languages, e.g. ...
32
2734
by: spibou | last post by:
Is the output of the C preprocessor deterministic ? What I mean by that is , given 2 compilers which conform to the same standard, will their preprocessors produce identical output given as input...
4
2070
by: pinkfloydhomer | last post by:
We might use the normal preprocessor something like this #define WIDTH 42 #define HEIGHT 100 #define AREA (WIDTH*HEIGHT) To have "42*100" is inserted in the code whereever AREA is used. But...
31
2884
by: Sam of California | last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing of the source file"? I responded to that comment by saying that the preprocessor is not just a pass. It processes...
3
303
by: Nathan Moinvaziri | last post by:
I am wonder if there is a way to use preprocessor definitions to expose code only if a particular file is included in a project. I am targeting the msvc. I am thinking of something like #if...
0
7202
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
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.