Sender: nate AT cartsys DOT com Message-ID: <378EC477.DA0C222D@cartsys.com> Date: Thu, 15 Jul 1999 22:34:47 -0700 From: Nate Eldredge X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.10 i586) MIME-Version: 1.0 To: djgpp AT delorie DOT com Subject: Re: Marker References: <378E8DD5 DOT 68B571A AT vetec DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com Andy Goth 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. If you don't care exactly where in the binary it ends up, you could just do static char my_comment[] = "Hello, world"; The compiler may warn you about an unused static variable, though. > I imagine that maybe I could do it with inline assembly that jumps over > a text string, but would the optimizer throw that out? If you want to have it in just the right place, then yes, you could do that. Using `volatile' will prevent the optimizer from moving or removing it (in fact I think it might not even be necessary for asms with no output). asm volatile("jmp 0f; .string \"Hello, world\"; 0:"); -- Nate Eldredge nate AT cartsys DOT com