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

gap-system / gap / 11314
4%

Build:
DEFAULT BRANCH: master
Ran 10 Jan 2020 04:28PM UTC
Jobs 8
Files 756
Run time 315min
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

pending completion
11314

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.

45 of 90 new or added lines in 38 files covered. (50.0%)

285804 of 337317 relevant lines covered (84.73%)

30026433.33 hits per line

Jobs
ID Job ID Ran Files Coverage
1 11314.1 (TEST_SUITES="docomp teststandard") 10 Jan 2020 04:28PM UTC 0
77.3
Travis Job 11314.1
2 11314.2 (TEST_SUITES="docomp teststandard" ABI=32 CONFIGFLAGS="") 10 Jan 2020 04:31PM UTC 0
77.25
Travis Job 11314.2
3 11314.3 (TEST_SUITES="docomp teststandard" ABI=64 HPCGAP=yes) 10 Jan 2020 04:30PM UTC 0
77.52
Travis Job 11314.3
4 11314.4 (TEST_SUITES="testpackages testinstall-loadall" ABI=64) 10 Jan 2020 04:29PM UTC 0
73.22
Travis Job 11314.4
6 11314.6 (TEST_SUITES="docomp testinstall") 10 Jan 2020 04:47PM UTC 0
73.23
Travis Job 11314.6
8 11314.8 (TEST_SUITES=testmanuals) 10 Jan 2020 04:44PM UTC 0
71.87
Travis Job 11314.8
9 11314.9 (TEST_SUITES=testbugfix CONFIGFLAGS="--enable-memory-checking") 10 Jan 2020 04:42PM UTC 0
60.65
Travis Job 11314.9
13 11314.13 (TEST_SUITES="testinstall" JULIA=yes CONFIGFLAGS="--disable-Werror") 10 Jan 2020 09:41PM UTC 0
73.15
Travis Job 11314.13
Source Files on build 11314
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #11314
  • 10d082eb on github
  • Prev Build on master (#11311)
  • Next Build on master (#11316)
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