unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* emacs.c broken by revision 1.435
@ 2008-07-23  7:24 Tim Van Holder
  2008-07-23  7:37 ` Miles Bader
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Tim Van Holder @ 2008-07-23  7:24 UTC (permalink / raw)
  To: emacs-devel

The "LINUX_SBRK_BUG" condition was incorrectly replaced with

#if (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
  __sbrk (1);
#endif

instead of

#if defined (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
  __sbrk (1);
#endif

resulting in a broken build.

I'm also not quite certain why a condition that was only present in an
Alpha header is now being used for all platforms. But I suppose the
__sbrk call is sufficiently harmless?




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  7:24 emacs.c broken by revision 1.435 Tim Van Holder
@ 2008-07-23  7:37 ` Miles Bader
  2008-07-23  7:50   ` Yavor Doganov
  2008-07-23  8:48 ` David Kastrup
  2008-07-23 19:57 ` Stefan Monnier
  2 siblings, 1 reply; 11+ messages in thread
From: Miles Bader @ 2008-07-23  7:37 UTC (permalink / raw)
  To: Tim Van Holder; +Cc: emacs-devel

"Tim Van Holder" <tim.vanholder@gmail.com> writes:
> The "LINUX_SBRK_BUG" condition was incorrectly replaced with
>
> #if (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
>
> instead of
>
> #if defined (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
>
> resulting in a broken build.

Why does the first result in a broken build?  Seems to work fine with
the C compilers I tried it with... (both with GNU_LINUX defined, and
with GNU_LINUX undefined)

-Miles

-- 
`Suppose Korea goes to the World Cup final against Japan and wins,' Moon said.
`All the past could be forgiven.'   [NYT]




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  7:37 ` Miles Bader
@ 2008-07-23  7:50   ` Yavor Doganov
  0 siblings, 0 replies; 11+ messages in thread
From: Yavor Doganov @ 2008-07-23  7:50 UTC (permalink / raw)
  To: emacs-devel

Miles Bader wrote:
> "Tim Van Holder" <tim.vanholder@gmail.com> writes:
> > The "LINUX_SBRK_BUG" condition was incorrectly replaced with
> >
> > #if (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
>
> Why does the first result in a broken build?

With GCC 4.3.1 on GNU/Linux:

emacs.c:830:15: error: missing expression between '(' and ')'





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  7:24 emacs.c broken by revision 1.435 Tim Van Holder
  2008-07-23  7:37 ` Miles Bader
@ 2008-07-23  8:48 ` David Kastrup
  2008-07-23  8:59   ` Miles Bader
                     ` (2 more replies)
  2008-07-23 19:57 ` Stefan Monnier
  2 siblings, 3 replies; 11+ messages in thread
From: David Kastrup @ 2008-07-23  8:48 UTC (permalink / raw)
  To: Tim Van Holder; +Cc: emacs-devel

"Tim Van Holder" <tim.vanholder@gmail.com> writes:

> The "LINUX_SBRK_BUG" condition was incorrectly replaced with
>
> #if (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
>   __sbrk (1);
> #endif
>
> instead of
>
> #if defined (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
>   __sbrk (1);
> #endif
>
> resulting in a broken build.

Can we rely on "defined" being available?  Seems like an ANSI feature to
me...  Maybe nested #ifdef and #if would be safer?

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  8:48 ` David Kastrup
@ 2008-07-23  8:59   ` Miles Bader
  2008-07-23  9:01   ` Juanma Barranquero
  2008-07-23 10:04   ` Jason Rumney
  2 siblings, 0 replies; 11+ messages in thread
From: Miles Bader @ 2008-07-23  8:59 UTC (permalink / raw)
  To: David Kastrup; +Cc: Tim Van Holder, emacs-devel

David Kastrup <dak@gnu.org> writes:
> Can we rely on "defined" being available?  Seems like an ANSI feature to
> me...  Maybe nested #ifdef and #if would be safer?

There's no way in hell that Emacs is going to compile with a pre-ansi
compiler, and trying to change that would be an absurd waste of time.

-Miles

-- 
Run away!  Run away!




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  8:48 ` David Kastrup
  2008-07-23  8:59   ` Miles Bader
@ 2008-07-23  9:01   ` Juanma Barranquero
  2008-07-23  9:21     ` David Kastrup
  2008-07-23 10:04   ` Jason Rumney
  2 siblings, 1 reply; 11+ messages in thread
From: Juanma Barranquero @ 2008-07-23  9:01 UTC (permalink / raw)
  To: David Kastrup; +Cc: Tim Van Holder, emacs-devel

On Wed, Jul 23, 2008 at 10:48, David Kastrup <dak@gnu.org> wrote:

> Can we rely on "defined" being available?

??

There are at least 490 instances of "#if defined" and "#if !defined"
in the src/ tree.

  Juanma




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  9:01   ` Juanma Barranquero
@ 2008-07-23  9:21     ` David Kastrup
  2008-07-23 10:49       ` Juanma Barranquero
  0 siblings, 1 reply; 11+ messages in thread
From: David Kastrup @ 2008-07-23  9:21 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Tim Van Holder, emacs-devel

"Juanma Barranquero" <lekktu@gmail.com> writes:

> On Wed, Jul 23, 2008 at 10:48, David Kastrup <dak@gnu.org> wrote:
>
>> Can we rely on "defined" being available?
>
> ??
>
> There are at least 490 instances of "#if defined" and "#if !defined"
> in the src/ tree.

I stand admonished.

-- 
David Kastrup




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  8:48 ` David Kastrup
  2008-07-23  8:59   ` Miles Bader
  2008-07-23  9:01   ` Juanma Barranquero
@ 2008-07-23 10:04   ` Jason Rumney
  2 siblings, 0 replies; 11+ messages in thread
From: Jason Rumney @ 2008-07-23 10:04 UTC (permalink / raw)
  To: David Kastrup; +Cc: Tim Van Holder, emacs-devel

David Kastrup wrote:

> Can we rely on "defined" being available?  Seems like an ANSI feature to
> me...  Maybe nested #ifdef and #if would be safer?

I think we already rely on it being available to such an extent that we
would have caught any problems with its use by now.





^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  9:21     ` David Kastrup
@ 2008-07-23 10:49       ` Juanma Barranquero
  0 siblings, 0 replies; 11+ messages in thread
From: Juanma Barranquero @ 2008-07-23 10:49 UTC (permalink / raw)
  To: David Kastrup; +Cc: Tim Van Holder, emacs-devel

On Wed, Jul 23, 2008 at 11:21, David Kastrup <dak@gnu.org> wrote:

> I stand admonished.

Not my intention at all. I was just surprised that you hadn't noticed
the "defined"s before (because they're quite conspicuous).

  Juanma




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23  7:24 emacs.c broken by revision 1.435 Tim Van Holder
  2008-07-23  7:37 ` Miles Bader
  2008-07-23  8:48 ` David Kastrup
@ 2008-07-23 19:57 ` Stefan Monnier
  2008-07-23 20:51   ` Dan Nicolaescu
  2 siblings, 1 reply; 11+ messages in thread
From: Stefan Monnier @ 2008-07-23 19:57 UTC (permalink / raw)
  To: Dan Nicolaescu; +Cc: emacs-devel

> The "LINUX_SBRK_BUG" condition was incorrectly replaced with
> #if (GNU_LINUX) && __GNU_LIBRARY__ - 0 < 6
>   __sbrk (1);
> #endif

Indeed Dan, this looks wrong.  Beside the obvious lack of "defined",
this change activates this code for all platforms rather than just
Alpha, and it makes the code less readable: the previous use of the
"LINUX_SBRK_BUG" identifier made it clear what the purpose was, and
clearly separated the bug&bugfix part from the detection of the bug.
I.e. the previous code was better.


        Stefan




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: emacs.c broken by revision 1.435
  2008-07-23 19:57 ` Stefan Monnier
@ 2008-07-23 20:51   ` Dan Nicolaescu
  0 siblings, 0 replies; 11+ messages in thread
From: Dan Nicolaescu @ 2008-07-23 20:51 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > I.e. the previous code was better.

The change was undone.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-07-23 20:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23  7:24 emacs.c broken by revision 1.435 Tim Van Holder
2008-07-23  7:37 ` Miles Bader
2008-07-23  7:50   ` Yavor Doganov
2008-07-23  8:48 ` David Kastrup
2008-07-23  8:59   ` Miles Bader
2008-07-23  9:01   ` Juanma Barranquero
2008-07-23  9:21     ` David Kastrup
2008-07-23 10:49       ` Juanma Barranquero
2008-07-23 10:04   ` Jason Rumney
2008-07-23 19:57 ` Stefan Monnier
2008-07-23 20:51   ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).