Re: [hatari-devel] Warnings

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


On 02/10/2020 at 23:05, Nicolas Pomarède wrote:
maybe -Wno-char-subscripts could be added to the cpu Makefile (as the code comes from WinUAE, I'd rather not change it too much ourselves, because it makes merging harder)

Sure -Wno-char-subscripts could be an option to silence the warnings. But there could be real bugs with accented characters on platforms where the char type is signed.

I see that Thomas has improved the situation.
Now there are only 2 problematic sources: build68k.c and readcpu.c. I assume that those sources come from WinUAE, so the issue should be fixed there.

Thanks for this work.

--
Vincent Rivière







[  0%] Building C object src/cpu/CMakeFiles/build68k.dir/build68k.c.o
In file included from /home/vincent/compil/hatari-HG-latest/src/cpu/compat.h:15,
                 from /home/vincent/compil/hatari-HG-latest/src/cpu/sysdeps.h:23,
                 from /home/vincent/compil/hatari-HG-latest/src/cpu/build68k.c:10:
/home/vincent/compil/hatari-HG-latest/src/cpu/build68k.c: In function ?main?:
/home/vincent/compil/hatari-HG-latest/src/cpu/build68k.c:314:18: warning: array subscript has type ?char? [-Wchar-subscripts]
  314 |   while (isspace(*opstrp))
      |                  ^~~~~~~
/home/vincent/compil/hatari-HG-latest/src/cpu/build68k.c:319:18: warning: array subscript has type ?char? [-Wchar-subscripts]
  319 |    if (!isspace (*osendp))
      |                  ^~~~~~~
/home/vincent/compil/hatari-HG-latest/src/cpu/build68k.c:331:19: warning: array subscript has type ?char? [-Wchar-subscripts]
  331 |   while (!isspace(*p++));
      |                   ^~~~

[ 16%] Building C object src/cpu/CMakeFiles/UaeCpu.dir/readcpu.c.o
In file included from /home/vincent/compil/hatari-HG-latest/src/cpu/compat.h:15,
                 from /home/vincent/compil/hatari-HG-latest/src/cpu/sysdeps.h:23,
                 from /home/vincent/compil/hatari-HG-latest/src/cpu/readcpu.c:10:
/home/vincent/compil/hatari-HG-latest/src/cpu/readcpu.c: In function ?build_insn?:
/home/vincent/compil/hatari-HG-latest/src/cpu/readcpu.c:324:42: warning: array subscript has type ?char? [-Wchar-subscripts]
  324 |   while (opcstr[pos] && !_istspace(opcstr[pos])) {
      |                                    ~~~~~~^~~~~
/home/vincent/compil/hatari-HG-latest/src/cpu/readcpu.c:324:26: note: in expansion of macro ?_istspace?
  324 |   while (opcstr[pos] && !_istspace(opcstr[pos])) {
      |                          ^~~~~~~~~
/home/vincent/compil/hatari-HG-latest/src/cpu/readcpu.c:360:41: warning: array subscript has type ?char? [-Wchar-subscripts]
  360 |   while (opcstr[pos] && _istspace(opcstr[pos]))
      |                                   ~~~~~~^~~~~
/home/vincent/compil/hatari-HG-latest/src/cpu/readcpu.c:360:25: note: in expansion of macro ?_istspace?
  360 |   while (opcstr[pos] && _istspace(opcstr[pos]))
      |                         ^~~~~~~~~



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/