Path: utzoo!utgpu!cunews!bnrgate!brtph3!brchh104!brchs1!bnr.ca!rice.edu!sun-spots-request From: fischer@iesd.auc.dk (Lars P. Fischer) Newsgroups: comp.sys.sun Subject: Re: Question on GNU C -- Openwin compatibility Keywords: Source Message-ID: <1126@brchh104.bnr.ca> Date: 9 Jan 91 00:26:34 GMT Sender: news@brchh104.bnr.ca Organization: Sun-Spots Lines: 47 Approved: Sun-Spots@rice.edu X-Refs: Original: v9n416 X-Sun-Spots-Digest: Volume 10, Issue 6, message 12 X-Note: Submissions: sun-spots@rice.edu, Admin: sun-spots-request@rice.edu >>>>> On 30 Dec 90 01:04:00 GMT, hista@jetson.uh.edu said: > I am having some rather crazy problems with my recently installed GNU C > compiler on the Sun4 platform. ... > when it comes down to files with inbuilt headers calling the xview > libraries, it messes up like mad. The header files for XView version 2 are set up to provide K&R C, ANSI C, or C++. Unfortunately, the ANSI C version has syntax errors (!). The problem is this: When using a variabel number of arguments for a function in ANSI C, you use the ellipsis notation, ie int printf (char*, ...); XView make use of this a lot. For some functions, XView does not want to tell anything about the arguments, hence int shhhh (...); BUT this is illegal. "...there must be at least one named argument;...", (K&R, 2.ed., p 155). To do that, one must say int shhhh ( ); That's an "old-style" declaration, with no type checking at all. Below is a patch for XView that fix the problem. save this article and go to ..../openwin/include/xview and say patch -p1 < xview.patch If it complains about a reverse patch, just say "y" (I always mess up the diff command. Sorry). Happy Hacking! Lars Fischer, fischer@iesd.auc.dk [[Ed's Note: Placed in archives - and I'll even update the index :) -bdg]] FTP: Hostname : titan.rice.edu (128.42.1.30) Directory: sun-source Filename : xview.patch Filesize : 8314 bytes Archive Server Address: archive-server@rice.edu Archive Server Command: send sun-source xview.patch