]> git.tuebingen.mpg.de Git - paraslash.git/commit
error.h: Be more careful with error code masking.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 6 May 2023 14:49:56 +0000 (16:49 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 9 May 2023 19:34:45 +0000 (21:34 +0200)
commit5364bf49a734ba76400d3eb31f42f6a861e64bef
treecc29661a2aa1cafdb3dbb0fc9ed888d0ffa011f3
parent42f73552054f4b013b5ba09da5400827f9c624f3
error.h: Be more careful with error code masking.

It should never happen that two or more of the three special high bits
(osl, lopsub, system) are set in an integer that stores a paraslash
error value, but gcc-12 can't prove this and complains as follows:

error.h:304:28: warning: array subscript 268435456 is above array bounds of 'const char * const[220]' [-Warray-bounds]
  304 |         return para_errlist[num];
      |                ~~~~~~~~~~~~^~~~~

Avoid this warning by always clearing all three special bits.
error.h