[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Koji cannot build emacs

On Thu, 9 Aug 2007, Roland McGrath wrote:

> > sound.c:1472:51: error: macro "open" requires 3 arguments, but only 1 given
> [...]
> > What should I do ?  Drop "-D_FORTIFY_SOURCE=2" from the CFLAGS?
> Nope.  Fix the program to be POSIX-compliant by not assuming open is not a
> macro.  You can replace open or foo->open with (open) or (foo->open),
> or you can add an #undef open where it's used.  The former is
> better.

This patch works:

--- emacs-22.1/src/sound.c~	2007-03-06 07:14:14.000000000 -0500
+++ emacs-22.1/src/sound.c	2007-08-09 15:54:52.117018000 -0400
@@ -1469,7 +1469,7 @@ Internal use only, use `play-sound' inst
       error ("No usable sound device driver found");
   /* Open the device.  */
-  current_sound_device->open (current_sound_device);
+  (current_sound_device->open) (current_sound_device);
   /* Play the sound.  */
   current_sound->play (current_sound, current_sound_device);

And I'm happy to build this way, however ...


"open" has to be one of the most overloaded names in programming.
Changing the semantics of that name is something that should be done
very carefully and very reluctantly, and I don't care what POSIX says
about it.



Charles M. "Chip" Coldwell
Senior Software Engineer
Red Hat, Inc

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]