[erlang-bugs] file:pread broken with GCC 4.8

Manish Singh yosh@REDACTED
Thu Aug 15 20:43:51 CEST 2013


I've also run into this problem:

http://erlang.org/pipermail/erlang-bugs/2013-July/003674.html

At first I thought it was a gcc bug, but
http://gcc.gnu.org/bugs/#reportsays "if compiling with
-fno-strict-aliasing -fwrapv
-fno-aggressive-loop-optimizations makes a difference, your code probably
is not correct." Compiling efile_drv.c with
-fno-aggressive-loop-optimizations makes the problem go away.

With -Wextra, there are warnings about signed/unsigned comparisons, which
might be causing this:

drivers/common/efile_drv.c:3749:14: note: in expansion of macro
‘EV_GET_UINT64’
      if (   !EV_GET_UINT64(ev, &d->c.preadv.offsets[i-1], &p, &q)
              ^
drivers/common/efile_drv.c:590:30: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
         *(pp) = (    *(pp)+8 < (ev)->iov[*(qp)].iov_len   \
                              ^
drivers/common/efile_drv.c:3749:14: note: in expansion of macro
‘EV_GET_UINT64’
      if (   !EV_GET_UINT64(ev, &d->c.preadv.offsets[i-1], &p, &q)
              ^
drivers/common/efile_drv.c:564:14: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
     (*(pp)+4 <= (ev)->iov[*(qp)].iov_len                  \
              ^
drivers/common/efile_drv.c:3750:7: note: in expansion of macro
‘EV_GET_UINT32’
   || !EV_GET_UINT32(ev, &sizeH, &p, &q)
       ^
drivers/common/efile_drv.c:569:30: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
         *(pp) = (    *(pp)+4 < (ev)->iov[*(qp)].iov_len   \
                              ^
drivers/common/efile_drv.c:3750:7: note: in expansion of macro
‘EV_GET_UINT32’
   || !EV_GET_UINT32(ev, &sizeH, &p, &q)
       ^
drivers/common/efile_drv.c:564:14: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
     (*(pp)+4 <= (ev)->iov[*(qp)].iov_len                  \
              ^
drivers/common/efile_drv.c:3751:7: note: in expansion of macro
‘EV_GET_UINT32’
   || !EV_GET_UINT32(ev, &sizeL, &p, &q)) {
       ^
drivers/common/efile_drv.c:569:30: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
         *(pp) = (    *(pp)+4 < (ev)->iov[*(qp)].iov_len   \
                              ^
drivers/common/efile_drv.c:3751:7: note: in expansion of macro
‘EV_GET_UINT32’
   || !EV_GET_UINT32(ev, &sizeL, &p, &q)) {
       ^
drivers/common/efile_drv.c:581:14: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
     (*(pp)+8 <= (ev)->iov[*(qp)].iov_len                  \

-Manish
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-bugs/attachments/20130815/4195566d/attachment.htm>


More information about the erlang-bugs mailing list