9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: David Morris <lists@morris-clan.net>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] plan9port build failure on Linux (debian)
Date: Mon,  3 Mar 2008 12:56:21 -0700	[thread overview]
Message-ID: <20080303195621.GF28226@morris-clan.net> (raw)
In-Reply-To: <20080303195459.GE28226@morris-clan.net>

On Mon, Mar 03, 2008 at 02:02:04PM -0500, erik quanstrom wrote:
> >
> > For what its worth, I just added the following lines to
> > yacc.c at the top of the file:
> >
> > #include <stdio.h>
> > #define sprint sprintf
> >
> > The build of plan9port just completed with no errors, the
> > problem is somewhere in sprint().
> >
> > I'll try and find time tonight to test out the plan9port
> > build to verify it works.  Let me know if I can provide any
> > other useful information.  I might try tracking down the bug
> > later this week, but not certain I'll have much time to do
> > so.
>
> it is very likely that you have broken yacc in a different
> way by doing this.  stdio formats are not compatable with
> plan 9 print formats.  for example, u is a flag when used
> with sprint but a verb when used with printf.
>
> (not to mention the fact that other programs than yacc
> use sprint.)

Just ran a quick test.  While the applications compiled,
they were non-functional as you suspected.  I tried
replacing the content of sprint() with vsprintf().  All
applications compiled and the functionality I've tried so
far (that used by the wmii window manager) seems to work.

Entirely possible, though, I've just been lucky in not
hitting a string parsed differently by sprint().

> have you verified that a standalone program with a
> similar print statement has the same problems?

I just gave it a try using the following:

============================================================
#define FILED       "tab.h"
#define stem        "bc"

int main(int argc, char** argv)
{
    /* Lines copied from yacc.c */
    char buf[256];
    int result = sprint(buf, "%s.%s", stem, FILED);
    printf("%i: %s\n", result, buf);
    /* End code from yacc.c */
    return 0;
}
============================================================

The result was the same as in yacc: return value of 0 and
'buf' is empty.

--David


  parent reply	other threads:[~2008-03-03 19:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03  4:20 David Morris
2008-03-03  5:23 ` Hongzheng Wang
     [not found]   ` <20080303084557.GA24732@morris-clan.net>
2008-03-03  8:46     ` David Morris
2008-03-03 15:09       ` sqweek
2008-03-03 16:25         ` David Morris
2008-03-03 16:17 ` Russ Cox
2008-03-03 17:27   ` David Morris
2008-03-03 19:02     ` erik quanstrom
     [not found]       ` <20080303195459.GE28226@morris-clan.net>
2008-03-03 19:56         ` David Morris [this message]
2008-03-04  4:42   ` Russ Cox
2008-03-05 16:21     ` Douglas A. Gwyn
2008-03-03 14:10 erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080303195621.GF28226@morris-clan.net \
    --to=lists@morris-clan.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).