#1403 closed defect (fixed)

TRUE and FALSE are not defined

Reported by: Sebastian Huber Owned by: Ralf Corsepius
Priority: normal Milestone: 4.10
Component: score Version: 4.10
Severity: normal Keywords:
Cc: ralf.corsepius@…, thomas.doerfler@…, sebastian.huber@…, vattam.santosh@… Blocked By:
Blocking:

Description

The CPU definition files for the super core use TRUE and FALSE heavily in preprocessor statements. These files are also supposed to work if they are included from an assembler file. Unfortunately TRUE and FALSE are defined in system.h which is not included in the CPU definition files, so these values are undefined in assembler files. This leads to

#if ( A == TRUE) -> true
#if ( A == FALSE) -> also true

in case A is defined in terms of TRUE and FALSE.

We have to ensure that TRUE and FALSE are defined before there usage. If we include system.h in cpu.h we have a cicular include which is not very elegant. We should mandate that types.h defines TRUE and FALSE and is also usable in assembler files.

One note to the types.h files: Do we really need them? They look very similar on each architecture and the stuff can be moved easily into a general types.h and the existing CPU specific cpu.h.

Change History (5)

comment:1 Changed on Apr 20, 2009 at 7:04:42 AM by Sebastian Huber

Cc: ralf.corsepius@… sebastian.huber@… added

comment:2 Changed on Apr 20, 2009 at 7:05:49 AM by Sebastian Huber

Cc: thomas.doerfler added

comment:3 Changed on Apr 20, 2009 at 10:08:54 AM by Joel Sherrill

Owner: changed from Joel Sherrill to Ralf Corsepius

comment:4 Changed on Dec 24, 2009 at 10:02:52 PM by Santosh Vattam

Cc: Santosh Vattam added

comment:5 Changed on Jul 16, 2010 at 7:51:32 AM by Sebastian Huber

Resolution: fixed
Status: newclosed

Added a new header file <rtems/score/basedefs.h> that defines TRUE and FALSE. This file will be included by <rtems/score/cpu.h> indirectly via <rtems/score/types.h>. Fixed in CVS head.

Note: See TracTickets for help on using tickets.