delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/17/13:35:22

From: ams AT ludd DOT luth DOT se (Martin Str|mberg)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Marker
Date: 16 Jul 1999 16:47:56 GMT
Organization: University of Lulea, Sweden
Lines: 18
Message-ID: <7mnnns$39l$1@news.luth.se>
References: <378E8DD5 DOT 68B571A AT vetec DOT com>
NNTP-Posting-Host: queeg.ludd.luth.se
X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Andy Goth (andygoth AT vetec DOT com) wrote:
: Is there any way of inserting a marker into C code that is compiled but
: not run?  It would be really helpful if I could put comments (of a sort)
: right into the binary.
: 
: I imagine that maybe I could do it with inline assembly that jumps over
: a text string, but would the optimizer throw that out?

Hmm. Will the compiler remove 'const char s[] = "My string\n";'?

If it does try 'struct { char s[], void *p } my_var = { "My string\n",
&my_var };' wihch I haven't tested but should work. The trick is to
make sure you reference the string somewhere in the code.


Welin, String Quartet No. 7,

							MartinS

- Raw text -


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