From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 3 Mar 2008 12:56:21 -0700 From: David Morris To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] plan9port build failure on Linux (debian) Message-ID: <20080303195621.GF28226@morris-clan.net> References: <20080303172726.GD28226@morris-clan.net> <6c49cc2fbe38c68838ffd940011de293@coraid.com> <20080303195459.GE28226@morris-clan.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080303195459.GE28226@morris-clan.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Topicbox-Message-UUID: 6db51532-ead3-11e9-9d60-3106f5b1d025 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 > > #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