Ticket #239 (closed defect: fixed)

Opened 15 years ago

Last modified 14 years ago

double declaration of bool false and true (conflicting with stdbool.h)

Reported by: Patrick Winnertz <winnie@…> Owned by: metux
Priority: major Milestone:
Component: mc-core Version: 4.6.2
Keywords: committed-master Cc:
Blocked By: Blocking:
Branch state: Votes for changeset:

Description (last modified by metux) (diff)

Hey,
There is already a definition of bool in C, which uses also false and true,
therefore mc fails to build with ncurses currently as ncurses include
stdbool.h> where these are defined:

#ifndef _STDBOOL_H
#define _STDBOOL_H

#ifndef cplusplus

#define bool _Bool
#define true 1
#define false 0

#else /* cplusplus */
.....
#endif

So we should remove this completly from mhl/* and use this instead.


branch:239_fix_bool
changeset:540fec5a7ab46e928536fdc38c6b3dfdf4483a8a

(this is for mc-4.6 branch, for master see #240)

Attachments

part0001.pgp (197 bytes) - added by Patrick Winnertz 15 years ago.
Added by email2trac

Change History

comment:1 Changed 15 years ago by Patrick Winnertz

  • id set to 239

This message has 0 attachment(s)

comment:2 Changed 15 years ago by metux

  • Owner set to metux
  • Status changed from new to accepted
  • Description modified (diff)
  • Milestone changed from 4.7 to 4.6.3

comment:3 Changed 15 years ago by metux

  • Keywords review added
  • Description modified (diff)

comment:4 Changed 15 years ago by winnie

  • Keywords vote-winnie added

comment:5 Changed 15 years ago by slyfox

  • Keywords vote-slyfox approved added; review removed

comment:6 Changed 15 years ago by metux

  • Keywords committed-master added; vote-winnie vote-slyfox approved removed
  • Status changed from accepted to testing
  • Resolution set to fixed

comment:7 Changed 15 years ago by andrew_b

  • Status changed from testing to reopened
  • Resolution fixed deleted

Which package provides <stdbool.h>? For me

$ slocate stdbool.h | grep include
/usr/lib/gcc/i586-alt-linux/4.1.1/include/stdbool.h
$ rpm -qf /usr/lib/gcc/i586-alt-linux/4.1.1/include/stdbool.h
gcc4.1-4.1.1-alt11

Semms <stdbool.h> is gcc-specific. It's OK if you don't care about other compilers.

comment:8 Changed 15 years ago by Patrick Winnertz

Hey,

?Semms <stdbool.h> is gcc-specific. It's OK if you don't care about other
?compilers.

No.. stdbool.h is not gcc-specific, it's part of C99:

http://en.wikipedia.org/wiki/Stdbool.h

Greetings
Winnie

Changed 15 years ago by Patrick Winnertz

Added by email2trac

comment:9 Changed 15 years ago by metux

  • Status changed from reopened to accepted

As winnie already said, stdbool.h is part of the C99 spec, so it part of the compiler (not libc, not kernel).

(note that GCC's language-spec specific header are sitting somewhere at /usr/lib/gcc-$ver/.../include, not /usr/include).

comment:10 Changed 15 years ago by metux

  • Status changed from accepted to testing
  • Resolution set to fixed

comment:11 Changed 15 years ago by styx

  • Status changed from testing to closed

comment:12 Changed 15 years ago by anonymous

  • Milestone 4.6.2.1 deleted

Milestone 4.6.2.1 deleted

Note: See TracTickets for help on using tickets.