Preprocessor/Compiler question

I

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:

VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

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


IBM
 
V

Victor Bazarov

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
 
I

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,113
Latest member
Vinay KumarNevatia
Top