- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- makefile padding white space while preprocessing
Operating System - HP-UX
1822146
Members
4270
Online
109640
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
Forums
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
тАО10-10-2008 12:30 AM
тАО10-10-2008 12:30 AM
makefile padding white space while preprocessing
I have two files make_incs.h and testfile. Below are the file contents:
make_incs.h:
------------
#define DH_JAVA_FILE_NAME test1
testfile:
----------
#include "./make_incs.h"
JVC=/opt/java1.5/bin/javac
PACKROOT=.
PACK_OPTION = -d $(PACKROOT)
JAVA_FILE_NAME=DH_JAVA_FILE_NAME+"Hai"
TARGETS=test.java $(JAVA_FILE_NAME).java
all: $(TARGETS)
@$(JVC) $(PACK_OPTION) $?
When we execute the below command I noticed a whitespace is appending to macro.
$ cc -E pmakefile
# 1 "pmakefile"
# 1 "./make_incs.h"
# 3 "testfile"
JVC=/opt/java1.5/bin/javac
PACKROOT=.
PACK_OPTION = -d $(PACKROOT)
JAVA_FILE_NAME=test1 +"Hai"
TARGETS=test.java $(JAVA_FILE_NAME).java
all: $(TARGETS)
@$(JVC) $(PACK_OPTION) $?
$
On the above, please notice a white space is adding after test1. I need sombody's help for how an extra space is comming afgter test1 and how to overcome this issue.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 04:01 AM
тАО10-10-2008 04:01 AM
Re: makefile padding white space while preprocessing
Hi,
the C-Preprocessor has its own thinking about padding, what is asumed to be an instruction...
Change your statement this way:
<< JAVA_FILE_NAME=test1 +"Hai"
to
>> JAVA_FILE_NAME=test1/**/+"Hai"
mfG Peter
the C-Preprocessor has its own thinking about padding, what is asumed to be an instruction...
Change your statement this way:
<< JAVA_FILE_NAME=test1 +"Hai"
to
>> JAVA_FILE_NAME=test1/**/+"Hai"
mfG Peter
The Universe is a pretty big place,
it's bigger than anything anyone has ever dreamed of before.
So if it's just us, seems like an awful waste of space, right?
Jodie Foster in "Contact"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 11:06 AM
тАО10-10-2008 11:06 AM
Re: makefile padding white space while preprocessing
Which "cc" is that? Around here, I can't
find a "cpp" which misbehaves:
dy # cc -E itrc.c | grep JAVA_FILE_NAME=
JAVA_FILE_NAME=test1+"Hai"
dy # /usr/ccs/lbin/cpp -E itrc.c | grep JAVA_FILE_NAME=
JAVA_FILE_NAME=test1+"Hai"
dy # /usr/local/bin/cpp -E itrc.c | grep JAVA_FILE_NAME=
JAVA_FILE_NAME=test1+"Hai"
dy # uname -a
HP-UX dy B.11.11 U 9000/785 2012616114 unlimited-user license
dy # cc -v
(Bundled) cc: NLSPATH is /usr/lib/nls/msg/%L/%N.cat:/usr/lib/nls/msg/C/%N.cat:
(Bundled) cc: CCOPTS is not set.
(Bundled) cc: INCLUDIR is INCLUDIR=/usr/include
dy # what /usr/ccs/lbin/cpp
/usr/ccs/lbin/cpp:
HP92453-01 B.11.11.02 HP C (Bundled) Preprocessor
$ Sep 8 2000 23:13:51 $
dy # /usr/local/bin/cpp --version
cpp (GCC) 4.3.2
[...]
find a "cpp" which misbehaves:
dy # cc -E itrc.c | grep JAVA_FILE_NAME=
JAVA_FILE_NAME=test1+"Hai"
dy # /usr/ccs/lbin/cpp -E itrc.c | grep JAVA_FILE_NAME=
JAVA_FILE_NAME=test1+"Hai"
dy # /usr/local/bin/cpp -E itrc.c | grep JAVA_FILE_NAME=
JAVA_FILE_NAME=test1+"Hai"
dy # uname -a
HP-UX dy B.11.11 U 9000/785 2012616114 unlimited-user license
dy # cc -v
(Bundled) cc: NLSPATH is /usr/lib/nls/msg/%L/%N.cat:/usr/lib/nls/msg/C/%N.cat:
(Bundled) cc: CCOPTS is not set.
(Bundled) cc: INCLUDIR is INCLUDIR=/usr/include
dy # what /usr/ccs/lbin/cpp
/usr/ccs/lbin/cpp:
HP92453-01 B.11.11.02 HP C (Bundled) Preprocessor
$ Sep 8 2000 23:13:51 $
dy # /usr/local/bin/cpp --version
cpp (GCC) 4.3.2
[...]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-10-2008 05:25 PM
тАО10-10-2008 05:25 PM
Re: makefile padding white space while preprocessing
It is illegal to use cpp(1) for any but C source:
Thus the output of cpp is designed to be in a form acceptable as input to the next pass of the C compiler. As the C language evolves, cpp and the rest of the C compilation package will be modified to follow these changes. Therefore, the use of cpp in other than this framework is not suggested.
>how to overcome this issue.
Several ways.
1) Why use cpp when make has macros?
Change to:
include make_incs.h
DH_JAVA_FILE_NAME=test1
JAVA_FILE_NAME=$(DH_JAVA_FILE_NAME)+"Hai"
2) Use the off chip K&R preprocessor:
cc -E +legacy_cpp=/usr/ccs/lbin/cpp
>Peter: Change your statement this way:
>> JAVA_FILE_NAME=test1/**/+"Hai"
I get even more spaces for all but K&R cpp, which doesn't need the kludge.
>Steven: I can't find a "cpp" which misbehaves:
Your crystal ball isn't working and you aren't on aC++, Integrity. :-)
And for PA it would only work for K&R mode.
Thus the output of cpp is designed to be in a form acceptable as input to the next pass of the C compiler. As the C language evolves, cpp and the rest of the C compilation package will be modified to follow these changes. Therefore, the use of cpp in other than this framework is not suggested.
>how to overcome this issue.
Several ways.
1) Why use cpp when make has macros?
Change to:
include make_incs.h
DH_JAVA_FILE_NAME=test1
JAVA_FILE_NAME=$(DH_JAVA_FILE_NAME)+"Hai"
2) Use the off chip K&R preprocessor:
cc -E +legacy_cpp=/usr/ccs/lbin/cpp
>Peter: Change your statement this way:
>> JAVA_FILE_NAME=test1/**/+"Hai"
I get even more spaces for all but K&R cpp, which doesn't need the kludge.
>Steven: I can't find a "cpp" which misbehaves:
Your crystal ball isn't working and you aren't on aC++, Integrity. :-)
And for PA it would only work for K&R mode.
- Tags:
- +legacy_cpp
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.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP