From owner-freebsd-stable Sat Dec 21 7:25: 2 2002 Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13B3C37B401 for ; Sat, 21 Dec 2002 07:25:01 -0800 (PST) Received: from OLYMPIC.AD.HartBrothers.Com (olympic.ad.hartbrothers.com [63.102.100.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D02343EDE for ; Sat, 21 Dec 2002 07:24:59 -0800 (PST) (envelope-from davehart@davehart.com) Subject: RE: More information (was Re: pthread woes) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Date: Sat, 21 Dec 2002 15:24:50 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: More information (was Re: pthread woes) Thread-Index: AcKo3wCpeWOq6P4kQYClRideNmgY4QAJHhpA From: "Dave Hart" To: Cc: , Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > From: ranjit@rugragging.com [mailto:ranjit@rugragging.com]=20 >=20 > Hello Emiel, >=20 > I tried and it failed, I think there's a syntax error in the=20 > first line. When I > change it to: >=20 > char XOpenDisplay() {}; >=20 > it works fine: Yes, but it's probably not what you want. You now have a program which is calling its own empty function called XOpenDisplay(). You probably want to call the XOpenDisplay from an X library instead: char XOpenDisplay(); That is a function declaration or prototype, your code above is a function _definition_, the key difference being yours has a body {} following the parameters (). > > --- test.c --- > >=20 > > char XOpenDisplay{}; > >=20 > > int main() { > > XOpenDisplay(); > > return 0; > > } > > --- end test.c --- The typo in the original code was using curly braces {} where parens were needed in char XOpenDisplay(); Or, for god's sake, the _error_ was trying to shortcut by duplicating a function declaration from some X header file when the Right Thing To Do is always to #include the appropriate .h header file containing the real declaration for XOpenDisplay(). It certainly would have saved needless hot air and wasted time on this thread. Dave To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message