[comp.sys.apollo] sr10.1 C preprocessor is broken ?

achille@cernvax.UUCP (achille) (01/24/89)

Hi, I'm having any sort of troubles using /bin/cc under sr10.1 on
a dn3000 and finally I think I found my problems in /usr/lib/cpp.
Here it is what happens:
cpp breaks (arbitrarily) lines and insert (wrong) line numbering information in the
middle, here is a short example:

line 38 in .c file:	printf("%s --- %2.2d/%2.2d/%1.1d\n",argv[0],d->tm_mon,d->tm_mday,d->tm_wday);

output from cc -E:	printf("%s ---
			# 42 "t_bks.c"
			%2.2d/%2.2d/%1.1d\n",argv[0],d->tm_mon,d->tm_mday,d->tm_wday);

The error I get is pretty clear:

 (0038) 	printf("%s ---

******** Line 38 of "t_bks.c": [Error #003]  Unterminated character string.

 (0042) %2.2d/%2.2d/%1.1d\n",argv[0],d->tm_mon,d->tm_mday,d->tm_wday);

******** Line 42 of "t_bks.c": [Error #068]  The types of [<string-constant>] and
         [  2.200000000000000    ] are not compatible with the "%" operator.

Using /com/cc everything works fine, the program compiles fine on sun and cray/unicos.
As everybody knows, /com/cc has its own cpp ! Don't tell me to /com/cc, I thought
sr10 was Unix, just Unix, bugs included (and new ones added ? :-)
As a side effect, when using dde to debug, I find myself debugging comment lines, thanx
to the wrong numbering cpp is introducing I guess.
I od'ed the file and there are no control characters (after all it was working under sr9.7)
Has anybody the same problem ?
Is there any non-broken apollo cpp around ?
I need a quick solution !

Advance thanx

Achille Petrilli
Cray and PWS operations

syd@dsinc.UUCP (Syd Weinstein) (01/27/89)

In article <913@cernvax.UUCP> achille@cernvax.UUCP () writes:
:Hi, I'm having any sort of troubles using /bin/cc under sr10.1 on
:a dn3000 and finally I think I found my problems in /usr/lib/cpp.
:Here it is what happens:
:cpp breaks (arbitrarily) lines and insert (wrong) line numbering information in the
:middle, here is a short example:
:
:line 38 in .c file:	printf("%s --- %2.2d/%2.2d/%1.1d\n",argv[0],d->tm_mon,d->tm_mday,d->tm_wday);
:
:output from cc -E:	printf("%s ---
:			# 42 "t_bks.c"
:			%2.2d/%2.2d/%1.1d\n",argv[0],d->tm_mon,d->tm_mday,d->tm_wday);
:
:The error I get is pretty clear:
:
: (0038) 	printf("%s ---
:
:******** Line 38 of "t_bks.c": [Error #003]  Unterminated character string.
:
: (0042) %2.2d/%2.2d/%1.1d\n",argv[0],d->tm_mon,d->tm_mday,d->tm_wday);
:
:******** Line 42 of "t_bks.c": [Error #068]  The types of [<string-constant>] and
:         [  2.200000000000000    ] are not compatible with the "%" operator.
:
I reported the same problem to Apollo, and am trying to get them to
write an APR.  The SR10.0 cpp works fine, and intresting enough
the /bsd4.3/usr/lib/cpp works fine, but the /sys5.3/usr/lib/cpp
is broken.  What I did was to change the symbolic link
in /lib to a shell script that checks the environment.  If the
environment is Sys5.3, it call /bsd4.3/usr/lib/cpp -I/sys5.3/usr/include $*
else it calls /bsd4.3/usr/lib/cpp $*.  That work around seems to
be ok for now.


-- 
=====================================================================
Sydney S. Weinstein, CDP, CCP                   Elm Coordinator
Datacomp Systems, Inc.				Voice: (215) 947-9900
{allegra,bpa,vu-vlsi}!dsinc!syd	                FAX:   (215) 938-0235