Skip to content

Release build fail, debug build warn, GCC11 #215

Description

@willwray

Guessing that these are GCC11 related, but haven't checked other versions.
gcc --version
gcc (GCC) 11.0.0 20210225 (Red Hat 11.0.0-0)

ninja -C build -f build-Release.ninja

In file included from ../jsrc/j.h:1019,
                 from ../jsrc/conjunctions/cu.c:6:
../jsrc/conjunctions/cu.c: In function ‘jtevery’:
../jsrc/jtype.h:167:19: error: array subscript ‘AD[0]’ is partly outside array bounds of ‘I[7]’
                                               {aka ‘long long int[7]’} [-Werror=array-bounds]
  167 | #define AK(x) ((x)->kchain.k)            // offset of ravel wrt x
      |                   ^~
../jsrc/ja.h:105:13: note: in expansion of macro ‘AK’
  105 |             AK((A)(v))    = (CAV(w) - (C *)(v));
      |             ^~
../jsrc/conjunctions/cu.c:55:9: note: in expansion of macro ‘fauxvirtual’
   55 |         fauxvirtual(virtw, virtblockw, w, 0, ACUC1);
      |         ^~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

The debug build gives a different warning of possible UB

[55/133] Building C object jsrc/CMakeFiles/j.dir/Debug/verbs/vfrom.c.o
In file included from ../jsrc/j.h:1017,
                 from ../jsrc/verbs/vfrom.c:6:
../jsrc/verbs/vfrom.c: In function ‘jtafrom’:
../jsrc/j.h:644:16: warning: operation on ‘jt->ranks’ may be undefined [-Wsequence-point]
  644 |      jt->ranks = (RANK2T)(I)z,                  \
../jsrc/ja.h:21:77: note: in definition of macro ‘df2’
   21 | #define df2(r, x, y, z) (r = ((r = (z)) ? (FAV(r)->valencefns[1])(jt, (x), (y), r) : r))
      |                                                                             ^
../jsrc/j.h:648:31: note: in expansion of macro ‘IRS1COMMON’
  648 | #define IRS1(w, fs, r, f1, z) IRS1COMMON(jt, w, fs, r, f1, z)           // nonneg rank
      |                               ^~~~~~~~~~
../jsrc/verbs/vfrom.c:484:22: note: in expansion of macro ‘IRS1’
  484 |                      IRS1(w, 0L, wcr, jtbox, ind),
      |                      ^~~~

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions