473,656 Members | 2,997 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:

VVVVVVVVVVVVVVV VVVVVVVVVVVVVVV VVVVVVVVVVVVVVV VVVVVVVVVVVVVVV VVVVVVVV
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 1608
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.or g> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.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
2119
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 defined = 2;
9
3651
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. Could someone point me to the appropriate section, or else confirm the behaviour as a bug? For a particular project, I am using the C preprocessor phase only. I am not using the standalone program 'cpp' because proper functioning of my project...
5
3059
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
2016
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? Is there any csc compiler option, that can produce the code after processing the macros/preprocessors? Thank you,
2
1071
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 evaluate them first (if they don't rely on variables)? For instance if I have #define WHITE RGB(255, 255, 255) does it simply replace instances of the word 'WHITE' with 'RGB(255, 255, 255)' or does the preprocessor
2
2803
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. http://www.zeitungsjunge.de/delphi/dipp/ DIPP is a Pascal Preprocessor. The purpose of DIPP is to manipulate Pascal source code files.
32
2773
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 the same file ? If not then how much variation is allowed ? Is it just a bit more or less white space here and there or could could there be larger differences ? If the output is not deterministic then is it possible that the output of the...
4
2083
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 does an evaluating preprocessor exist that can do some evaluation on expressions so that AREA becomes 4200?
31
2907
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 statements that the compiler does not process. The good people in the alt.comp.lang.learn.c-c++ newsgroup insist that the preprocessor is just one of many passes. The preprocessor processes a grammer unique to the preprocessor and only that grammer. ...
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 defined(filecabinet.h) // if filecabinet.h is part of the project ....
0
8296
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8497
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8598
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7310
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5627
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4299
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1598
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.