Re: [PATCH] Fix compilation with iso C standard

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/27/20 9:18 PM, Simon Zeni wrote:
> The whole repo can now be built with iso C standard (c89, c99 and c11)
> 
> Signed-off-by: Simon Zeni <simon@xxxxxxxxxxxx>
> ---
> 
> References to the compiler extension `typeof` have been changed to
> `__typeof__` for portability. See [GCC's documentation][1] about
> `typeof`.
> 
> I've added the definition `_POSIX_C_SOURCE` in the source files that are
> using functions not defined in by the POSIX standard, fixing a few
> occurences of `sigset_t` not being defined.
> 
> I've also added the definition `_BSD_SOURCE` in `setup.c` and
> `syscall.c` for respectively the `madvise` function (I know that
> `posix_madvise` exists, but there is not equivalent for
> `MADV_DONTFORK`), and `syscall`.

All of this good stuff should be in the commit message before
the '---' or it won't make it into the git log. Which would be a
shame!

I get a bunch of these with this applied:

In file included from /usr/include/x86_64-linux-gnu/sys/types.h:25,
                 from setup.c:4:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~


-- 
Jens Axboe




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux