ANSI strings, comment style, ...

Ian Lance Taylor ian@cygnus.com
Tue Nov 4 16:43:00 GMT 1997


   Date: Wed, 5 Nov 1997 11:10:31 +1030
   From: Ian Dall <Ian.Dall@dsto.defence.gov.au>

   To be honest I was not sure this was new in ANSI. We are not talking
   about cpp "#" and "##" operations. What I think we are talking about
   is writing:

		     printf("A very long string. Warning: unacceptable argument to %s instruction", insn);

   as

		     printf("A very long string."
			    "Warning: unacceptable argument to %s instruction\n",
			     insn);


Yes, that sort of string concatenation is new in ANSI.

   If this is not acceptable, what is the preferred way to do this? I'd
   sooner not make it two printf's and I think

		     printf("A very long string.\
   Warning: unacceptable argument to %s instruction\n", insn);

   Is almost as ugly as just letting the line wrap.

I say, let the line wrap.  If it really bugs you, initialize a
variable and print that.

Note that you need a space between the `printf' and the open
parenthesis in your example.  In your first example, you can, and
should, put ``insn'' on the next line.

Ian



More information about the Gas2 mailing list