public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Turn some C warnings into errors by default
@ 2023-11-13 13:09 Florian Weimer
  2023-11-13 13:09 ` [PATCH 1/6] c-family: Introduce pedpermerror Florian Weimer
                   ` (6 more replies)
  0 siblings, 7 replies; 29+ messages in thread
From: Florian Weimer @ 2023-11-13 13:09 UTC (permalink / raw)
  To: gcc-patches

This patch series converts the following warnings into errors by
default:

  -Wint-conversion
  -Wimplicit-function-declaration
  -Wimplicit-int
  -Wreturn-mismatch
  -Wincompatible-pointer-types

As explained in the first commit, I decided not to use permerror_opt
because it does not exhibit the existing behavior for -pedantic-errors.

The impact on existing sources of the last commit is not really known to
me at this point.  I plan to start a Fedora build later this week with
an instrumented compiler, to see how much of a compatible impact it will
be.  The first conversion pass through Fedora only covered
-Wimplicit-function-declaration, -Wimplicit-int.  I started looking at
-Wint-conversion, and it did not seem to be too bad, so I think
including it should be fine.  I'm more worried about
-Wincompatible-pointer-types.

I have not yet added a new overview test for -fpermissive.  Such a test
should trigger all the dozen or so places where I introduced
pedpermerror, and see what happens under multiple dialects, each with
-fpermissive and without, and maybe also with and withoyt for
-pedantic-errors in -std=gnu89 and default modes.  I plan to do this
once I get some initial feedback on the direction of these series
because this test would likely be obsolete fairly quickly if changes to
the diagnostics are required.  I did copy some existing tests to test
both the error and warning (-fpermissive) diagnostics, and adjusted
others to expect errors, so there is already quite a bit coverage
without that overview test.

Right now, this series breaks the build on aarch64-linux-gnu due to an
incompatible pointer assignment in libgcc:

  [PATCH] aarch64: Avoid -Wincompatible-pointer-types warning in Linux unwinder
  <https://inbox.sourceware.org/gcc-patches/874jht5tsq.fsf@oldenburg.str.redhat.com/>

Other targets had the same issue previously, but I've already fixed most
of them (I hope).  There could of course be similar issues lurking in
target-specific code, or even in system headers.

With the recent testsuite fixes, the testsuite should be fairly clean
despite these changes.  I verified that on i686-linux-gnu,
powerpc64-linux-gnu, and x86_64-linux-gnu.  There is one
aarch64-linux-gnu testsuite change I'd like the AArch64 maintainers to
review:

  [PATCH] aarch64: Call named function in gcc.target/aarch64/aapcs64/ice_1.c
  <https://inbox.sourceware.org/gcc-patches/87r0kx6eez.fsf@oldenburg.str.redhat.com/>

Recently, I also found a problem in the gm2 testsuite:

  [PATCH] gm2: Add missing declaration of m2pim_M2RTS_Terminate to test
  <https://inbox.sourceware.org/gcc-patches/874jhp3nwf.fsf@oldenburg.str.redhat.com/>

Thanks,
Florian


Florian Weimer (6):
  c-family: Introduce pedpermerror
  c: Turn int-conversion warnings into permerrors
  c: Turn -Wimplicit-function-declaration into a pedpermerror
  c: Turn -Wimplicit-int into a pedpermerror
  c: Turn -Wreturn-mismatch into a pedpermerror
  c: Turn -Wincompatible-pointer-types into a pedpermerror

 gcc/c-family/c-common.h                       |   4 +
 gcc/c-family/c-warn.cc                        |  34 ++++
 gcc/c/c-decl.cc                               |  40 ++--
 gcc/c/c-typeck.cc                             | 164 +++++++++------
 gcc/diagnostic-core.h                         |   3 +
 gcc/diagnostic.cc                             |   7 +
 gcc/doc/invoke.texi                           |  33 +++-
 gcc/testsuite/c-c++-common/pr77624-1.c        |   4 +-
 .../c-c++-common/spellcheck-reserved.c        |   4 +-
 gcc/testsuite/gcc.dg/20030906-1.c             |   2 +-
 gcc/testsuite/gcc.dg/20030906-1a.c            |  21 ++
 gcc/testsuite/gcc.dg/20030906-2.c             |   2 +-
 gcc/testsuite/gcc.dg/20030906-2a.c            |  21 ++
 .../Wimplicit-function-declaration-c99-2.c    |   7 +
 .../Wimplicit-function-declaration-c99.c      |   2 +-
 gcc/testsuite/gcc.dg/Wimplicit-int-1.c        |   2 +-
 gcc/testsuite/gcc.dg/Wimplicit-int-1a.c       |  11 ++
 gcc/testsuite/gcc.dg/Wimplicit-int-4.c        |   2 +-
 gcc/testsuite/gcc.dg/Wimplicit-int-4a.c       |  11 ++
 .../gcc.dg/Wincompatible-pointer-types-2.c    |   2 +-
 .../gcc.dg/Wincompatible-pointer-types-4.c    |   2 +-
 .../gcc.dg/Wincompatible-pointer-types-5.c    |  10 +
 .../gcc.dg/Wincompatible-pointer-types-6.c    |  10 +
 gcc/testsuite/gcc.dg/Wint-conversion-2.c      |   2 +-
 gcc/testsuite/gcc.dg/Wint-conversion-3.c      |   2 +-
 gcc/testsuite/gcc.dg/Wint-conversion-4.c      |  14 ++
 gcc/testsuite/gcc.dg/Wreturn-mismatch-1.c     |   2 +-
 gcc/testsuite/gcc.dg/Wreturn-mismatch-1a.c    |  40 ++++
 gcc/testsuite/gcc.dg/Wreturn-mismatch-2.c     |   2 +-
 gcc/testsuite/gcc.dg/Wreturn-mismatch-2a.c    |  41 ++++
 gcc/testsuite/gcc.dg/anon-struct-11.c         |   5 +-
 gcc/testsuite/gcc.dg/anon-struct-11a.c        | 111 +++++++++++
 gcc/testsuite/gcc.dg/anon-struct-13.c         |   2 +-
 gcc/testsuite/gcc.dg/anon-struct-13a.c        |  76 +++++++
 gcc/testsuite/gcc.dg/assign-warn-1.c          |   2 +-
 gcc/testsuite/gcc.dg/assign-warn-4.c          |  21 ++
 .../gcc.dg/builtin-arith-overflow-4.c         |   2 +-
 .../gcc.dg/builtin-arith-overflow-4a.c        |  43 ++++
 gcc/testsuite/gcc.dg/c23-qual-4.c             |   6 +-
 gcc/testsuite/gcc.dg/dfp/composite-type-2.c   |  58 ++++++
 gcc/testsuite/gcc.dg/dfp/composite-type.c     |   2 +-
 gcc/testsuite/gcc.dg/diag-aka-1.c             |   2 +-
 gcc/testsuite/gcc.dg/diag-aka-1a.c            |  29 +++
 .../gcc.dg/diagnostic-range-bad-return-2.c    |  52 +++++
 .../gcc.dg/diagnostic-range-bad-return.c      |   2 +-
 gcc/testsuite/gcc.dg/diagnostic-types-1.c     |   2 +-
 gcc/testsuite/gcc.dg/diagnostic-types-2.c     |  24 +++
 gcc/testsuite/gcc.dg/enum-compat-1.c          |   2 +-
 gcc/testsuite/gcc.dg/enum-compat-2.c          |  32 +++
 gcc/testsuite/gcc.dg/func-ptr-conv-1.c        |   2 +-
 gcc/testsuite/gcc.dg/func-ptr-conv-2.c        |  56 ++++++
 gcc/testsuite/gcc.dg/gnu23-attr-syntax-2.c    |   2 +-
 gcc/testsuite/gcc.dg/gnu23-attr-syntax-3.c    |  17 ++
 gcc/testsuite/gcc.dg/gomp/pr35738-2.c         |  18 ++
 gcc/testsuite/gcc.dg/gomp/pr35738.c           |   2 +-
 gcc/testsuite/gcc.dg/init-bad-7.c             |   2 +-
 gcc/testsuite/gcc.dg/init-bad-7a.c            |  12 ++
 gcc/testsuite/gcc.dg/init-excess-3.c          |   4 +-
 gcc/testsuite/gcc.dg/missing-header-fixit-1.c |   2 +-
 .../gcc.dg/missing-header-fixit-1a.c          |  37 ++++
 gcc/testsuite/gcc.dg/missing-header-fixit-2.c |   2 +-
 .../gcc.dg/missing-header-fixit-2a.c          |  31 +++
 gcc/testsuite/gcc.dg/missing-header-fixit-4.c |   2 +-
 .../gcc.dg/missing-header-fixit-4a.c          |  27 +++
 gcc/testsuite/gcc.dg/missing-header-fixit-5.c |   2 +-
 .../gcc.dg/missing-header-fixit-5a.c          |  42 ++++
 .../gcc.dg/noncompile/incomplete-3.c          |   2 +-
 gcc/testsuite/gcc.dg/noncompile/pr79758-2.c   |   6 +
 gcc/testsuite/gcc.dg/noncompile/pr79758.c     |   1 +
 gcc/testsuite/gcc.dg/overflow-warn-1.c        |   4 +-
 gcc/testsuite/gcc.dg/overflow-warn-3.c        |   4 +-
 gcc/testsuite/gcc.dg/param-type-mismatch-2.c  | 187 ++++++++++++++++++
 gcc/testsuite/gcc.dg/param-type-mismatch.c    |   2 +-
 gcc/testsuite/gcc.dg/pointer-array-atomic-2.c |  60 ++++++
 gcc/testsuite/gcc.dg/pointer-array-atomic.c   |   2 +-
 gcc/testsuite/gcc.dg/pointer-array-quals-1.c  |   6 +-
 gcc/testsuite/gcc.dg/pr105635-2.c             |  11 ++
 gcc/testsuite/gcc.dg/pr105635.c               |   2 +-
 gcc/testsuite/gcc.dg/pr23075-2.c              |  14 ++
 gcc/testsuite/gcc.dg/pr23075.c                |   2 +-
 gcc/testsuite/gcc.dg/pr29521-a.c              |  15 ++
 gcc/testsuite/gcc.dg/pr29521.c                |   2 +-
 gcc/testsuite/gcc.dg/pr61162-2.c              |   2 +-
 gcc/testsuite/gcc.dg/pr61162-3.c              |  13 ++
 gcc/testsuite/gcc.dg/pr61852.c                |   4 +-
 gcc/testsuite/gcc.dg/pr67730-a.c              |  11 ++
 gcc/testsuite/gcc.dg/pr67730.c                |   2 +-
 gcc/testsuite/gcc.dg/spec-barrier-3.c         |   2 +-
 gcc/testsuite/gcc.dg/spec-barrier-3a.c        |  13 ++
 .../gcc.dg/spellcheck-identifiers-1a.c        | 136 +++++++++++++
 .../gcc.dg/spellcheck-identifiers-2.c         |   2 +-
 .../gcc.dg/spellcheck-identifiers-2a.c        |  33 ++++
 .../gcc.dg/spellcheck-identifiers-3.c         |   2 +-
 .../gcc.dg/spellcheck-identifiers-3a.c        |  45 +++++
 .../gcc.dg/spellcheck-identifiers-4.c         |   2 +-
 .../gcc.dg/spellcheck-identifiers-4a.c        |  10 +
 gcc/testsuite/gcc.dg/spellcheck-identifiers.c |   2 +-
 gcc/testsuite/gcc.dg/transparent-union-1.c    |   2 +-
 gcc/testsuite/gcc.dg/transparent-union-1a.c   |  85 ++++++++
 .../gcc.target/aarch64/acle/memtag_2.c        |   4 +-
 .../gcc.target/aarch64/acle/memtag_2a.c       |  71 +++++++
 .../sve/acle/general-c/ld1sh_gather_1.c       |   2 +-
 .../aarch64/sve/acle/general-c/load_2.c       |   4 +-
 .../aarch64/sve/acle/general-c/load_3.c       |   2 +-
 .../acle/general-c/load_ext_gather_index_1.c  |   2 +-
 .../load_ext_gather_index_restricted_1.c      |   2 +-
 .../acle/general-c/load_ext_gather_offset_1.c |   4 +-
 .../acle/general-c/load_ext_gather_offset_2.c |   4 +-
 .../acle/general-c/load_ext_gather_offset_3.c |   4 +-
 .../acle/general-c/load_ext_gather_offset_4.c |   4 +-
 .../acle/general-c/load_ext_gather_offset_5.c |   4 +-
 .../load_ext_gather_offset_restricted_1.c     |   4 +-
 .../load_ext_gather_offset_restricted_2.c     |   4 +-
 .../load_ext_gather_offset_restricted_3.c     |   4 +-
 .../load_ext_gather_offset_restricted_4.c     |   4 +-
 .../aarch64/sve/acle/general-c/sizeless-1.c   |   8 +-
 .../aarch64/sve/acle/general-c/sizeless-2.c   |   8 +-
 .../aarch64/sve/acle/general-c/store_1.c      |   8 +-
 .../aarch64/sve/acle/general-c/store_2.c      |  10 +-
 .../acle/general-c/store_scatter_index_1.c    |   8 +-
 .../store_scatter_index_restricted_1.c        |   8 +-
 .../acle/general-c/store_scatter_offset_2.c   |   8 +-
 .../store_scatter_offset_restricted_1.c       |   8 +-
 .../aarch64/sve/acle/general/attributes_7.c   |  28 +--
 .../i386/sse2-bfloat16-scalar-typecheck.c     |   4 +-
 .../i386/vect-bfloat16-typecheck_1.c          |   4 +-
 .../i386/vect-bfloat16-typecheck_2.c          |   4 +-
 .../gcc.target/powerpc/conditional-return.c   |   2 +-
 128 files changed, 1920 insertions(+), 231 deletions(-)
 create mode 100644 gcc/testsuite/gcc.dg/20030906-1a.c
 create mode 100644 gcc/testsuite/gcc.dg/20030906-2a.c
 create mode 100644 gcc/testsuite/gcc.dg/Wimplicit-function-declaration-c99-2.c
 create mode 100644 gcc/testsuite/gcc.dg/Wimplicit-int-1a.c
 create mode 100644 gcc/testsuite/gcc.dg/Wimplicit-int-4a.c
 create mode 100644 gcc/testsuite/gcc.dg/Wincompatible-pointer-types-5.c
 create mode 100644 gcc/testsuite/gcc.dg/Wincompatible-pointer-types-6.c
 create mode 100644 gcc/testsuite/gcc.dg/Wint-conversion-4.c
 create mode 100644 gcc/testsuite/gcc.dg/Wreturn-mismatch-1a.c
 create mode 100644 gcc/testsuite/gcc.dg/Wreturn-mismatch-2a.c
 create mode 100644 gcc/testsuite/gcc.dg/anon-struct-11a.c
 create mode 100644 gcc/testsuite/gcc.dg/anon-struct-13a.c
 create mode 100644 gcc/testsuite/gcc.dg/assign-warn-4.c
 create mode 100644 gcc/testsuite/gcc.dg/builtin-arith-overflow-4a.c
 create mode 100644 gcc/testsuite/gcc.dg/dfp/composite-type-2.c
 create mode 100644 gcc/testsuite/gcc.dg/diag-aka-1a.c
 create mode 100644 gcc/testsuite/gcc.dg/diagnostic-range-bad-return-2.c
 create mode 100644 gcc/testsuite/gcc.dg/diagnostic-types-2.c
 create mode 100644 gcc/testsuite/gcc.dg/enum-compat-2.c
 create mode 100644 gcc/testsuite/gcc.dg/func-ptr-conv-2.c
 create mode 100644 gcc/testsuite/gcc.dg/gnu23-attr-syntax-3.c
 create mode 100644 gcc/testsuite/gcc.dg/gomp/pr35738-2.c
 create mode 100644 gcc/testsuite/gcc.dg/init-bad-7a.c
 create mode 100644 gcc/testsuite/gcc.dg/missing-header-fixit-1a.c
 create mode 100644 gcc/testsuite/gcc.dg/missing-header-fixit-2a.c
 create mode 100644 gcc/testsuite/gcc.dg/missing-header-fixit-4a.c
 create mode 100644 gcc/testsuite/gcc.dg/missing-header-fixit-5a.c
 create mode 100644 gcc/testsuite/gcc.dg/noncompile/pr79758-2.c
 create mode 100644 gcc/testsuite/gcc.dg/param-type-mismatch-2.c
 create mode 100644 gcc/testsuite/gcc.dg/pointer-array-atomic-2.c
 create mode 100644 gcc/testsuite/gcc.dg/pr105635-2.c
 create mode 100644 gcc/testsuite/gcc.dg/pr23075-2.c
 create mode 100644 gcc/testsuite/gcc.dg/pr29521-a.c
 create mode 100644 gcc/testsuite/gcc.dg/pr61162-3.c
 create mode 100644 gcc/testsuite/gcc.dg/pr67730-a.c
 create mode 100644 gcc/testsuite/gcc.dg/spec-barrier-3a.c
 create mode 100644 gcc/testsuite/gcc.dg/spellcheck-identifiers-1a.c
 create mode 100644 gcc/testsuite/gcc.dg/spellcheck-identifiers-2a.c
 create mode 100644 gcc/testsuite/gcc.dg/spellcheck-identifiers-3a.c
 create mode 100644 gcc/testsuite/gcc.dg/spellcheck-identifiers-4a.c
 create mode 100644 gcc/testsuite/gcc.dg/transparent-union-1a.c
 create mode 100644 gcc/testsuite/gcc.target/aarch64/acle/memtag_2a.c


base-commit: b51bfee1beed03872ea0289cb47dd2336d9f528c
prerequisite-patch-id: f46d6a56470ab459865ba2e45372d60e131b9ee2
prerequisite-patch-id: 7e0b407ec2bbd5e3b9c7ed1342b08d3677a65283
prerequisite-patch-id: 02e95117add6ada9d5cdb489399fb2e562db76e2
-- 
2.41.0


^ permalink raw reply	[flat|nested] 29+ messages in thread
* [PATCH 2/6] c: Turn int-conversion warnings into permerrors
@ 2023-12-02  0:33 钟居哲
  2023-12-02  1:10 ` Patrick O'Neill
  2023-12-02  1:13 ` Sam James
  0 siblings, 2 replies; 29+ messages in thread
From: 钟居哲 @ 2023-12-02  0:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: thomas, fweimer

[-- Attachment #1: Type: text/plain, Size: 22009 bytes --]

Hi, This patch cause error on building newlib/glibc/musl on RISC-V port:

/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_access.c:8:40: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    8 |   return syscall_errno (SYS_access, 2, file, mode, 0, 0, 0, 0);
      |                                        ^~~~
      |                                        |
      |                                        const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_access.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_utime.c:5:39: warning: 'struct utimbuf' declared inside parameter list will not be visible outside of this definition or declaration
    5 | _utime(const char *path, const struct utimbuf *times)
      |                                       ^~~~~~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_faccessat.c: In function '_faccessat':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_faccessat.c:7:50: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    7 |   return syscall_errno (SYS_faccessat, 4, dirfd, file, mode, flags, 0, 0);
      |                                                  ^~~~
      |                                                  |
      |                                                  const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_faccessat.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
make[5]: *** [Makefile:3315: riscv/riscv_libgloss_a-sys_access.o] Error 1
make[5]: *** Waiting for unfinished jobs....
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_open.c: In function '_open':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_open.c:8:38: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    8 |   return syscall_errno (SYS_open, 3, name, flags, mode, 0, 0, 0);
      |                                      ^~~~
      |                                      |
      |                                      const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_open.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_openat.c: In function '_openat':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_openat.c:7:47: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    7 |   return syscall_errno (SYS_openat, 4, dirfd, name, flags, mode, 0, 0);
      |                                               ^~~~
      |                                               |
      |                                               const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_openat.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
make[5]: *** [Makefile:3427: riscv/riscv_libgloss_a-sys_faccessat.o] Error 1
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_link.c: In function '_link':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_link.c:7:38: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    7 |   return syscall_errno (SYS_link, 2, old_name, new_name, 0, 0, 0, 0);
      |                                      ^~~~~~~~
      |                                      |
      |                                      const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_link.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_link.c:7:48: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    7 |   return syscall_errno (SYS_link, 2, old_name, new_name, 0, 0, 0, 0);
      |                                                ^~~~~~~~
      |                                                |
      |                                                const char *
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstat.c: In function '_fstat':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstat.c:12:47: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   12 |   int rv = syscall_errno (SYS_fstat, 2, file, &kst, 0, 0, 0, 0);
      |                                               ^~~~
      |                                               |
      |                                               struct kernel_stat *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstat.c:3:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'struct kernel_stat *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstatat.c: In function '_fstatat':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstatat.c:11:50: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   11 |   int rv = syscall_errno (SYS_fstatat, 4, dirfd, file, &kst, flags, 0, 0);
      |                                                  ^~~~
      |                                                  |
      |                                                  const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstatat.c:3:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_fstatat.c:11:56: error: passing argument 5 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   11 |   int rv = syscall_errno (SYS_fstatat, 4, dirfd, file, &kst, flags, 0, 0);
      |                                                        ^~~~
      |                                                        |
      |                                                        struct kernel_stat *
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_unlink.c: In function '_unlink':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:58: note: expected 'long int' but argument is of type 'struct kernel_stat *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                                     ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_unlink.c:8:40: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    8 |   return syscall_errno (SYS_unlink, 1, name, 0, 0, 0, 0, 0);
      |                                        ^~~~
      |                                        |
      |                                        const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_unlink.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_access.c: In function '_access':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_access.c:8:40: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    8 |   return syscall_errno (SYS_access, 2, file, mode, 0, 0, 0, 0);
      |                                        ^~~~
      |                                        |
      |                                        const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_access.c:2:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_read.c: In function '_read':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_read.c:8:44: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    8 |   return syscall_errno (SYS_read, 3, file, ptr, len, 0, 0, 0);
      |                                            ^~~
      |                                            |
      |                                            void *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_read.c:3:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'void *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
make[5]: *** [Makefile:3609: riscv/riscv_libgloss_a-sys_open.o] Error 1
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_lstat.c: In function '_lstat':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_lstat.c:10:41: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   10 |   int rv = syscall_errno (SYS_lstat, 2, file, &kst, 0, 0, 0, 0);
      |                                         ^~~~
      |                                         |
      |                                         const char *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_lstat.c:3:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_lstat.c:10:47: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   10 |   int rv = syscall_errno (SYS_lstat, 2, file, &kst, 0, 0, 0, 0);
      |                                               ^~~~
      |                                               |
      |                                               struct kernel_stat *
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'struct kernel_stat *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_write.c: In function '_write':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_write.c:9:45: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
    9 |   return syscall_errno (SYS_write, 3, file, ptr, len, 0, 0, 0);
      |                                             ^~~
      |                                             |
      |                                             const void *
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_write.c:3:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'const void *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_stat.c: In function '_stat':
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_stat.c:11:40: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   11 |   int rv = syscall_errno (SYS_stat, 2, file, &kst, 0, 0, 0, 0);
      |                                        ^~~~
      |                                        |
      |                                        const char *
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_gettimeofday.c: In function '_gettimeofday':
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_stat.c:3:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'const char *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_stat.c:11:46: error: passing argument 4 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   11 |   int rv = syscall_errno (SYS_stat, 2, file, &kst, 0, 0, 0, 0);
      |                                              ^~~~
      |                                              |
      |                                              struct kernel_stat *
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_gettimeofday.c:29:46: error: passing argument 3 of 'syscall_errno' makes integer from pointer without a cast [-Wint-conversion]
   29 |   return syscall_errno (SYS_gettimeofday, 1, tp, 0, 0, 0, 0, 0);
      |                                              ^~
      |                                              |
      |                                              struct timeval *
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:48: note: expected 'long int' but argument is of type 'struct kernel_stat *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                           ~~~~~^~~
In file included from /work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/sys_gettimeofday.c:4:
/work/home/jzzhong/work/toolchain/riscv/build/dev-rv64gcv_zvfh_zfh-lp64d-medany-newlib-spike-debug/../../newlib/libgloss/riscv/internal_syscall.h:66:38: note: expected 'long int' but argument is of type 'struct timeval *'
   66 | syscall_errno(long n, int argc, long _a0, long _a1, long _a2, long _a3, long _a4, long _a5)
      |                                 ~~~~~^~~
make[5]: *** [Makefile:3623: riscv/riscv_libgloss_a-sys_openat.o] Error 1
make[5]: *** [Makefile:3567: riscv/riscv_libgloss_a-sys_link.o] Error 1
make[5]: *** [Makefile:3455: riscv/riscv_libgloss_a-sys_fstat.o] Error 1
make[5]: *** [Makefile:3469: riscv/riscv_libgloss_a-sys_fstatat.o] Error 1
make[5]: *** [Makefile:3707: riscv/riscv_libgloss_a-sys_unlink.o] Error 1
make[5]: *** [Makefile:4127: riscv/riscv_libsim_a-sys_access.o] Error 1
make[5]: *** [Makefile:3637: riscv/riscv_libgloss_a-sys_read.o] Error 1
make[5]: *** [Makefile:3595: riscv/riscv_libgloss_a-sys_lstat.o] Error 1
make[5]: *** [Makefile:3749: riscv/riscv_libgloss_a-sys_write.o] Error 1
make[5]: *** [Makefile:3665: riscv/riscv_libgloss_a-sys_stat.o] Error 1
make[5]: *** [Makefile:3525: riscv/riscv_libgloss_a-sys_gettimeofday.o] Error 1




juzhe.zhong@rivai.ai

^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2023-12-05  0:25 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-13 13:09 [PATCH 0/6] Turn some C warnings into errors by default Florian Weimer
2023-11-13 13:09 ` [PATCH 1/6] c-family: Introduce pedpermerror Florian Weimer
2023-11-13 19:22   ` Jeff Law
2023-11-14  7:39   ` Florian Weimer
2023-11-13 13:10 ` [PATCH 2/6] c: Turn int-conversion warnings into permerrors Florian Weimer
2023-11-13 19:24   ` Jeff Law
2023-11-13 19:44   ` [PATCH 2/6] c: Turn int-conversion warnings into permerrors [PR106416] Sam James
2023-12-01 11:29   ` [PATCH 2/6] c: Turn int-conversion warnings into permerrors Thomas Schwinge
2023-12-01 11:36     ` Florian Weimer
2023-11-13 13:10 ` [PATCH 3/6] c: Turn -Wimplicit-function-declaration into a pedpermerror Florian Weimer
2023-11-13 19:25   ` Jeff Law
2023-11-13 19:42   ` [PATCH 3/6] c: Turn -Wimplicit-function-declaration into a pedpermerror [PR91092] Sam James
2023-11-13 13:11 ` [PATCH 4/6] c: Turn -Wimplicit-int into a pedpermerror Florian Weimer
2023-11-13 19:26   ` Jeff Law
2023-11-13 19:45   ` [PATCH 4/6] c: Turn -Wimplicit-int into a pedpermerror [PR91093] Sam James
2023-11-13 13:11 ` [PATCH 5/6] c: Turn -Wreturn-mismatch into a pedpermerror Florian Weimer
2023-11-13 19:28   ` Jeff Law
2023-11-13 13:11 ` [PATCH 6/6] c: Turn -Wincompatible-pointer-types " Florian Weimer
2023-11-13 19:30   ` Jeff Law
2023-11-13 19:44 ` [PATCH 0/6] Turn some C warnings into errors by default Sam James
2023-12-02  0:33 [PATCH 2/6] c: Turn int-conversion warnings into permerrors 钟居哲
2023-12-02  1:10 ` Patrick O'Neill
2023-12-02  1:53   ` 钟居哲
2023-12-02  3:25     ` Patrick O'Neill
2023-12-02  1:13 ` Sam James
2023-12-02  3:40   ` Jeff Law
2023-12-02  5:47     ` Sam James
2023-12-02 15:19       ` Jeff Law
2023-12-04  7:45         ` Kito Cheng
2023-12-05  0:25           ` Kito Cheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).