public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: "Martin Liška" <mliska@suse.cz>
Cc: gcc-patches@gcc.gnu.org, Jonathan Wakely <jwakely.gcc@gmail.com>
Subject: Re: [PATCH] Remove legacy pre-C++ 11 definitions
Date: Fri, 6 Jan 2023 09:21:06 -0800	[thread overview]
Message-ID: <CA+=Sn1n=pXk-EdgdtsbHpOc-R79GD1UB6R0KS9xA0wjFPwdBHw@mail.gmail.com> (raw)
In-Reply-To: <6defa548-2da3-6cba-0372-f1e6c6b64c81@suse.cz>

On Fri, Jan 6, 2023 at 4:21 AM Martin Liška <mliska@suse.cz> wrote:
>
> As mentioned in the PRs, both are defined in C++ 11
> which is a version we depend on.
>
> Ready to be installed now?

There is another #define NULL below:
/* System headers may define NULL to be an integer (e.g. 0L), which cannot be
   used safely in certain contexts (e.g. as sentinels).  Redefine NULL to
   nullptr in order to make it safer.  Note that this might confuse system
   headers, however, by convention they must not be included after this point.
*/
#ifdef __cplusplus
#undef NULL
#define NULL nullptr
#endif

Thanks,
Andrew Pinski

>
> Thanks,
> Martin
>
>         PR middle-end/108311
>         PR middle-end/108312
>
> gcc/ChangeLog:
>
>         * system.h (va_copy): Remove as it is defined in C++ 11.
>         (NULL): Likewise.
> ---
>  gcc/system.h | 13 -------------
>  1 file changed, 13 deletions(-)
>
> diff --git a/gcc/system.h b/gcc/system.h
> index 5eaeb9d2d03..0d06b9749e5 100644
> --- a/gcc/system.h
> +++ b/gcc/system.h
> @@ -31,25 +31,12 @@ along with GCC; see the file COPYING3.  If not see
>  /* We must include stdarg.h before stdio.h.  */
>  #include <stdarg.h>
>
> -#ifndef va_copy
> -# ifdef __va_copy
> -#   define va_copy(d,s)  __va_copy (d, s)
> -# else
> -#   define va_copy(d,s)  ((d) = (s))
> -# endif
> -#endif
> -
>  #ifdef HAVE_STDDEF_H
>  # include <stddef.h>
>  #endif
>
>  #include <stdio.h>
>
> -/* Define a generic NULL if one hasn't already been defined.  */
> -#ifndef NULL
> -#define NULL 0
> -#endif
> -
>  /* Use the unlocked open routines from libiberty.  */
>
>  /* Some of these are #define on some systems, e.g. on AIX to redirect
> --
> 2.39.0
>

  reply	other threads:[~2023-01-06 17:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-06 12:21 Martin Liška
2023-01-06 17:21 ` Andrew Pinski [this message]
2023-01-06 18:23   ` Jonathan Wakely
2023-01-09 15:17     ` Martin Liška
2023-01-09 15:19       ` Jonathan Wakely
2023-01-10  8:32         ` Martin Liška

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+=Sn1n=pXk-EdgdtsbHpOc-R79GD1UB6R0KS9xA0wjFPwdBHw@mail.gmail.com' \
    --to=pinskia@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).