Hi Dennis,

On Thu, Jul 15, 2010 at 12:11 AM, Dennis Wassel
<dwas...@math.uni-bremen.de> wrote:
> Hi Bruce,
>
> I sent this to the list yesterday and got an auto-reply that I'd have to
> subscribe (which I did) and to give you a heads-up to fish this one out
> of your spam.
> So here you are!
>
> Cheers,
> Dennis
>
> -------- Original-Nachricht --------
> Betreff: [Autogen-users] Spurious whitespace in "dne" output
> Datum: Wed, 14 Jul 2010 17:23:21 +0200
> Von: Dennis Wassel <dwas...@math.uni-bremen.de>
> An: autogen-users@lists.sourceforge.net
>
> Hi list, hi Bruce,
>
> I am using the dne command like this
>
>  (dne "-d" " * " "/*")
[...]
> which is fine, except....
>
> Specifically, x86_64 Ubuntu 10.04's autogen (5.10) produces
>  "AutoGen-ed" (no whitespace)
> while i686 Debian5's autogen 5.9.5 and self-compiled 5.10.2 both insist
> on producing
>  "AutoGen-ed  " (2 whitespaces)
> so this always turns up in the diffs, which is nothing drastic, but
> still a PITA.

It isn't supposed to happen, as well as being a PITA.

> I hunted this down to something like a printf format string in
> agen5/expFormat.c, but I could not make much sense of it, particularly
> there are no two evil spaces hidden here.
>
> Any help?

This is the format:

static char const zDne[] = "%6$s"
"%1$sDO NOT EDIT THIS FILE   (%2$s)\n"
"%1$s\n"
"%1$sIt has been AutoGen-ed%3$s\n"
"%1$sFrom the definitions    %4$s\n"
"%1$sand the template file   %5$s";

I will certainly concede that how that format gets used is a bit obscure, but
the final result is basically:

static char const zDne1[] =
"%s -*- buffer-read-only: t -*- vi: set ro:\n"
"%s\n";
  asprintf(&str, zDne1, "/*", " * ")

  sprintf(zDne, " * ", out_fname, "", def_fname, tpl_fname, str);

Even more complicating is the fact that in order to compute printf arguments
on the fly, "snprintfv" was invented (an "argv" style printf library because
libffi was not around at the time).  So, it is possible that the snv_asprintfv
has gone south for this platform, but I'd surely hope not.  It has been stable
for some years now.

I hate to ask people to use GDB, but this is not something that is happening
for me, so I think it would be best, if you are willing.

Please remake the thing with CFLAGS='-g -O0' LDFLAGS=-static thus:

   cd $top_builddir/agen5
   rm -f *.o
   make autogen CFLAGS='-g -O0' LDFLAGS=-static
   dbgag=$PWD/autogen

cd into your build directory and:

   gdb --args $dbgag <<whatever>>

and set a break point in ag_scm_dne().  Step through until you get to
the line:
   pzRes = aprf(ENABLED_OPT(WRITABLE) .....
and examine the arguments on the Debian5 platform.

(gdb) p *pzPrefix
(gdb) p *pfp->pzOutName
(gdb) p (char *)zScribble
(gdb) p pz
(gdb) p pzTemplFileName
(gdb) p pzFirst

In particular, the ``p (char *)zScribble'' should print the empty string because
"noDate" should be set to 1.  Apparently, Debian5 is emitting two space
characters when it should not be.  If you see the spaces in this GDB session,
something is awry in agen5 code.  If not, then it is either in the snprintfv
code or it is further down in the bowels of Debian5.

Sorry for the bother.  I would surely appreciate understanding the issue!!

Regards, Bruce

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Autogen-users mailing list
Autogen-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/autogen-users

Reply via email to