Re: Update on the Modern C initiative

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

 



* Richard W. M. Jones:

> On Thu, Nov 30, 2023 at 06:09:55PM +0100, Florian Weimer wrote:
>> nbdkit               rjones
>
> Can you help me to understand the build error in this log?
>
> https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/raw/main/logs/n/nbdkit.log?ref_type=heads
>
> I'm not exactly sure what / where the error is supposed to be.
>
> Possibly it is complaining about this autoconf test, but I don't
> understand what's wrong with the cast, since AFAIK making a pointer
> "more const" should be fine:
>
>   configure:20816: checking if environ is declared in header files
>   configure:20833: gcc -c -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Werror=implicit-function-declaration -Werror=implicit-int -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   conftest.c >&5
>   conftest.c: In function 'test':
>   conftest.c:62:22: error: initialization of 'const char **' from incompatible pointer type 'char **'
>      62 |   const char **env = environ;
>         |                      ^~~~~~~
>
> (source: https://gitlab.com/nbdkit/nbdkit/-/blob/380f975bb9a07063f370835c51e1cd248a799485/configure.ac#L327)

The inner pointer is const, not the outer pointer.  The rule about
compatibility only applies to the outer const, not to any inner const.

Thanks,
Florian
--
_______________________________________________
devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Users]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]

  Powered by Linux