https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95700

vvinayag at arm dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vvinayag at arm dot com

--- Comment #10 from vvinayag at arm dot com ---
(In reply to CVS Commits from comment #9)
> The master branch has been updated by Ilya Leoshkevich <i...@gcc.gnu.org>:
> 
> https://gcc.gnu.org/g:d59a576b8b5e12c3a56f0262912090e2921f5daa
> 
> commit r11-1785-gd59a576b8b5e12c3a56f0262912090e2921f5daa
> Author: Ilya Leoshkevich <i...@linux.ibm.com>
> Date:   Mon Jun 29 20:36:03 2020 +0200
> 
>     Redefine NULL to nullptr
>     
>     Bootstrap with musl libc fails with numerous "missing sentinel in
>     function call" errors.  This is because musl defines NULL as 0L for C++,
>     but gcc requires sentinel value to be a pointer or __null.
>     
>     Jonathan Wakely says:
>     
>         To be really safe during stage 1, GCC should not use NULL as a
>         pointer sentinel in C++ code anyway.
>     
>         The bootstrap compiler could define it to 0 or 0u, neither of which
>         is guaranteed to be OK to pass as a varargs sentinel where a null
>         pointer is expected.  Any of (void*)0 or (void*)NULL or nullptr
>         would be safe.
>     
>     While it is possible to fix this by replacing NULL sentinels with
>     nullptrs, such approach would generate backporting conflicts, therefore
>     simply redefine NULL to nullptr at the end of system.h, where it would
>     not confuse system headers.
>     
>     gcc/ChangeLog:
>     
>     2020-06-30  Ilya Leoshkevich  <i...@linux.ibm.com>
>     
>             PR bootstrap/95700
>             * system.h (NULL): Redefine to nullptr.

I think this patch breaks arm native and aarch64 native builds when compiling
gcc/gcc/genmodes.c.

gcc/gcc/genmodes.c: In function 'const char* get_mode_class(mode_data*)':

gcc/gcc/system.h:1273:14: error: 'nullptr' was not declared in this scope
 #define NULL nullptr
              ^
gcc/gcc/genmodes.c:1221:14: note: in expansion of macro 'NULL'
       return NULL;
              ^

Reply via email to