[230] in Athena Bugs
A bug with
daemon@ATHENA.MIT.EDU (John Carr)
Tue Apr 19 12:58:11 1988
To: bugs@ATHENA.MIT.EDU
Date: Tue, 19 Apr 88 11:57:28 EST
From: John Carr <jfc@ATHENA.MIT.EDU>
If this is not the right address for X problems, please forward
to the appropriate person(s).
Program with which you had the problem:
X library include file /usr/include/X11/Xlib.h
Name of person who discovered the bug: John Carr
Their MIT phone number: 5-6185
Their MIT address: East Campus GDL 110
Their Athena Login ID: jfc
Name of consultant reporting bug:
------------------------------------------------------------------------
A brief synopsis of the problem:
Not all functions, especially those returning int, are defined in Xlib.h
------------------------------------------------------------------------
Please describe the problem in detail:
The Xlib.h include file (same for RT and vax, as far as I can tell)
does not contain definitions for many functions returning int (or a
typedef equivalent). While this is not a problem normally, it causes
errors when the first use of a function involves taking the address,
because the compiler thinks it is an undefined variable, prints an
error message, and defaults the type to int (instead of int() ).
I had reason to do this in my program: I wrote a function which had
a pointer to an Xlib function as a parameter.
------------------------------------------------------------------------
Repeat by (please enter a set of commands which will allow us to
repeat the bug):
#include<X11/Xlib.h>
#include<stdio.h>
main()
{
printf("%x\n",XOpenDisplay); /* Works */
printf("%x\n",XCheckWindowEvent); /* Compiler gets upset */
}
------------------------------------------------------------------------
Fix (if you know what it is):
Include all functions in Xlib.h, even int().