- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: #define compiler problem still occurring - sti...
Operating System - HP-UX
1758650
Members
2147
Online
108874
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 07:57 AM
тАО05-15-2001 07:57 AM
I tried using the backslash notation for long #define lines for my code and no luck. Errors from the A.03.27 aCC compiler are still generated. I looked at the 3.27 doc and found the following:
"NOTE: The replacement-list must fit on one line. If the line becomes too long, it can be broken up into several lines provided that all lines but the last are terminated by a "\" character. The following is an example.
#define mac very very long \replacement string
The "\" must be the last character on the line. You cannot add any spaces or comments after it."
Notice that the doc says to use a backslash. Neither convention works for me. If I look at the standard includes, I see backslash continuation characters used throughout.
Is there a compiler switch that I need to implement this behavior? My current settings are
"-c +z +p -AA +DAportable +DD32 -DHPUX -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -D_RWSTD_MULTI_THREAD -D_RWSTD_TEMPLATE"
Thanks in advance for any help...
"NOTE: The replacement-list must fit on one line. If the line becomes too long, it can be broken up into several lines provided that all lines but the last are terminated by a "\" character. The following is an example.
#define mac very very long \replacement string
The "\" must be the last character on the line. You cannot add any spaces or comments after it."
Notice that the doc says to use a backslash. Neither convention works for me. If I look at the standard includes, I see backslash continuation characters used throughout.
Is there a compiler switch that I need to implement this behavior? My current settings are
"-c +z +p -AA +DAportable +DD32 -DHPUX -D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L -D_HPUX_SOURCE -D_RWSTD_MULTI_THREAD -D_RWSTD_TEMPLATE"
Thanks in advance for any help...
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 08:15 AM
тАО05-15-2001 08:15 AM
Solution
did you verify that there are no whitspace charactes after the backslashes? Use ":set list" in vi to see them. The lines must end with "\$", where "$" represents the NL line terminator.
There is a live before death!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 08:30 AM
тАО05-15-2001 08:30 AM
Re: #define compiler problem still occurring - still an hpux newbie
Hi Steve,
I running Version A.3.30 of aCC and everything worked fine.
I defined a macro like this:
denotes a single backslash character at the end of the line (no trailing spaces)
#define swap(a,b,temp)
{
temp = a;
a = b;
b = temp;
}
Then in the main:
int main()
{
int aa = -1,bb = 1,cc = 0;
printf("Hello world\n");
swap(aa,bb,cc);
return(0);
}
when I did an aCC -P myfile.c I got a myfile.i
which looked like this:
int main()
{
int aa = -1,bb = 1,cc = 0;
printf("Hello world\n");
{ cc = aa; aa = bb; bb = cc};
return(0);
}
Exactly what you would expect; you might try upgrading to the 3.30 version but I would also
create a macro exactly like the one above first as a test. There may be an upper limit to the length of a multi-line macro but I have used some fairly large ones (> 300 chars) without problems.
Regards, Clay
I running Version A.3.30 of aCC and everything worked fine.
I defined a macro like this:
#define swap(a,b,temp)
{
temp = a;
a = b;
b = temp;
}
Then in the main:
int main()
{
int aa = -1,bb = 1,cc = 0;
printf("Hello world\n");
swap(aa,bb,cc);
return(0);
}
when I did an aCC -P myfile.c I got a myfile.i
which looked like this:
int main()
{
int aa = -1,bb = 1,cc = 0;
printf("Hello world\n");
{ cc = aa; aa = bb; bb = cc};
return(0);
}
Exactly what you would expect; you might try upgrading to the 3.30 version but I would also
create a macro exactly like the one above first as a test. There may be an upper limit to the length of a multi-line macro but I have used some fairly large ones (> 300 chars) without problems.
Regards, Clay
If it ain't broke, I can fix that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-15-2001 10:32 AM
тАО05-15-2001 10:32 AM
Re: #define compiler problem still occurring - still an hpux newbie
Thanks to all.
The problem turned out to be characters after the continuation backslash. Our source is originally written on MS clients and stored to VSS. MS puts CR/LF at end of line. Unix is only LF. I was getting the extra CR character after the continuation character.
Thanks to all for the help!!!
The problem turned out to be characters after the continuation backslash. Our source is originally written on MS clients and stored to VSS. MS puts CR/LF at end of line. Unix is only LF. I was getting the extra CR character after the continuation character.
Thanks to all for the help!!!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP