• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gap-system / gap / 11314 / 2
4%
master: 4%

Build:
DEFAULT BRANCH: master
Ran 10 Jan 2020 04:31PM UTC
Files 652
Run time 49s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Jan 2020 03:28PM UTC coverage: 77.249%. Remained the same
TEST_SUITES="docomp teststandard" ABI=32 CONFIGFLAGS=""

push

travis-ci

fingolfin
kernel: introduce BOOL, TRUE, FALSE

This adds `typedef Int BOOL`; the resulting C type `BOOL` can be used to
indicate that the return type of a function is supposed to be a boolean.
Matching integer constants TRUE=1 and FALSE=0 are also added.

The reason we are not using type `bool` from stdbool.h and the constants
`true` and `false`, all available in C99, is the following: in C99, a pointer
is automatically converted to type bool if necessary. That means that if one
by accident writes `return False` instead of `return false` in a function with
return type `BOOL`, then no compiler warning is issued. Instead, a bug is
introduced, as `False` is a non-NULL pointer, and thus is cast to the `bool`
value `true`.

With this commit, we get warnings similar to the following if we mix up
TRUE/True or FALSE/False; while if using `bool`, we'd only get the latter two
warnings, but not the first one.

    src/objects.c:897:12: error: incompatible pointer to integer conversion
          returning 'Obj' (aka 'unsigned long **') from a function with result
          type 'BOOL' (aka 'unsigned char') [-Werror,-Wint-conversion]
        return False;
               ^~~~~

    src/objects.c:1185:39: error: pointer/integer type mismatch in conditional
          expression ('int' and 'Obj' (aka 'unsigned long **'))
          [-Werror,-Wconditional-type-mismatch]
        return (TNUM_OBJ(obj) == T_COMOBJ ? TRUE : False);
                                          ^ ~~~~   ~~~~~

    src/objects.c:1337:16: error: incompatible integer to pointer conversion
          returning 'int' from a function with result type 'Obj' (aka
          'unsigned long **') [-Werror,-Wint-conversion]
            return TRUE;
                   ^~~~

Note that on the long run, it would be better to switch to something like
`typedef char BOOL`, but that breaks at least one package (NormalizInterface),
so let's postpone that until all affected packages with kernel extensions have
switched to using BOOL.

243383 of 315062 relevant lines covered (77.25%)

4868676.32 hits per line

Source Files on job 11314.2 (TEST_SUITES="docomp teststandard" ABI=32 CONFIGFLAGS="")
  • Tree
  • List 0
  • Changed 87
  • Source Changed 52
  • Coverage Changed 75
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 3258
  • Travis Job 11314.2
  • 10d082eb on github
  • Prev Job for TEST_SUITES="docomp teststandard" ABI=32 CONFIGFLAGS="" on master (#11311.2)
  • Next Job for TEST_SUITES="docomp teststandard" ABI=32 CONFIGFLAGS="" on master (#11316.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc