[RFA/RFC] printf (stderr,... ->fprintf_unfiltered (gdb_stderr,... in hpread.c

Andrew Cagney ac131313@cygnus.com
Thu Apr 25 08:38:00 GMT 2002


> On Wed, Apr 24, 2002 at 11:50:40AM -0700, Michael Snyder wrote:
> 
>> Daniel Jacobowitz wrote:
> 
>> > 
>> > On Wed, Apr 24, 2002 at 03:16:16PM +0200, Pierre Muller wrote:
> 
>> > > This is a second of the files that I listed in
>> > > http://sources.redhat.com/ml/gdb/2002-02/msg00212.html
>> > > as still having direct uses of stderr.
>> > >
>> > > I did not fix a 80 char overflow, because I didn't find a good way to do it:
>> > > If I try to align the string "Psymtab for %s already read in.  Shouldn't happen.\n"
>> > > with gdb_stderr, I still get an overflow, how show I indent the args then?
>> > > Should I break the string constant?
> 
>> > 
>> > Yes, I'd recommend:
>> > 
>> > -      fprintf (stderr, "Psymtab for %s already read in.  Shouldn't happen.\n",
>> > +      fprintf_unfiltered (gdb_stderr, "Psymtab for %s already read in.  "
>> > "Shouldn't happen.\n",

The other is the more traditional:

	..... "\
Psymtab for ......\n\
.......\n"

(the ``\'' at the end of the line is needed.

>> 
>> 
>> I thought there was some kind of caveat against the use of
>> string concatenation ?
> 
> 
> Perhaps you're thinking of token concatenation, or stringification?  Or
> multiline strings?  I believe "a" "b" has worked even in K&R compilers.

Some, not all.  But yes string concatenation like the above is fine for GDB.

(Pierre, yes, ok with a tweak).

Andrew




More information about the Gdb-patches mailing list