www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/02/08/06:16:36

Date: Wed, 8 Feb 1995 05:09:44 -0400 (AST)
From: Bill Davidson <bdavidson AT ra DOT isisnet DOT com>
Subject: problems making ldbg
To: djgpp AT sun DOT soe DOT clarkson DOT edu

Hi:
I guess I erased the original thread, but someone had problems rebuiling 
ladybug.  So did I, but mine were different.  I got segmentation 
violations while make was compiling fullscr.c (specifically cc1.exe).
On a hunch, since topline indicated that available physical memory was 
about to be exhausted when it crashed, I eliminated the -g option from 
CCOPTS in the makefile.  Then everything went peachy until I crashed at 
the same place the other fellow did, under as.
The offending line looked like this:
asm("
[snip]
/*	movw $something, offs(%reg) */	/* comment this out */	\n\
[snip]
				\n");
or something like that.  Anyway, the assembler was gagging on a comment 
from an asm("") statement.  The other fellow deleted the line, I chose to 
uncomment it just to see if it would compile.  In both cases, no problem.
So I created a bogus test file with an asm section containing a comment 
and typed "gcc -S test.c" and examined test.s.
First, as understands /**/ comments in any file I write.
Second, the lines of the .s file containing my asm() statement were 
bracketed by
/APP
and
/NO-APP.
Hmmm... the as docs speak of .APP and #APP, no mention of /APP.
So I tried changing the pseudo-ops and it still wouldn't assemble.
The docs indicate that when a line begins #APP, the following lines will 
be preprocessed by the internal preprocessor until #NO-APP, even if the 
-f option is in force or if handling output from a compiler.  Since gcc 
does not pass -f to the assembler, I assume its behaviour is modified by 
some environment variable, but the /APP should still override that 
behaviour!  Does anyone have an explanation?
There are plenty of workarounds to avoid comments in quoted strings in 
asm statements (like don't put them there or instead of terminating a line 
with \ close the quote and start the quote again on the next line (and 
let cpp concatenate the strings), then you can comment out the whole 
quoted string), but as is supposed to recognize that construct.  That's 
why cc1 does it, isn't it?


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019