Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Cc: gdb-patches@sourceware.org
Subject: Re: Fix tui compilation with Solaris libcurses (PR tui/21482)
Date: Fri, 19 May 2017 13:39:00 -0000	[thread overview]
Message-ID: <f8bb369c-e9e1-755b-ddf5-5dd2d142bab9@redhat.com> (raw)
In-Reply-To: <83h90h2dbu.fsf@gnu.org>

On 05/19/2017 02:20 PM, Eli Zaretskii wrote:
>> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>> Cc: gdb-patches@sourceware.org
>> Date: Fri, 19 May 2017 14:50:06 +0200
>>
>> I've checked in the cast part now.  Here's the NOMACROS part for
>> gdb_curses.h.  Tested as before on sparcv9-sun-solaris2.10 (curses) and
>> amd64-pc-solaris2.12 (ncurses).  Ok too?
> 
> I think this should be guarded by some OS-specific macro, so as not to
> affect other platforms, where the original problem doesn't exist. 

The problem exists, we just hadn't tripped on it yet.  
Googling around we see people running into curses defining "move" as
macro for instance, which conflicts with std::move.  

So I'd rather take the opposite approach.  GDB must be able to compile
with  NOMACROS defined on some hosts, so defining it everywhere makes
gdb behave the same everywhere and reduces the testing axis.  A patch
introducing a problem for Solaris or any host using the same curses
will be quickly exposed on any host.

> (I
> see 6 instances of these macros being tested in my ncurses headers,
> and I'm not on Solaris.)  Who knows what new problems this could cause?

I expect it'll fix more problems than create them.  Defining macros without
some sort of namespace prefix in C++ is a sure recipe for problems.
NOMACROS was surely invented to avoid these problems.

Thanks,
Pedro Alves


      parent reply	other threads:[~2017-05-19 13:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18  8:56 Rainer Orth
2017-05-18 13:19 ` Pedro Alves
2017-05-18 13:36   ` Rainer Orth
2017-05-19 12:50     ` Rainer Orth
2017-05-19 12:52       ` Pedro Alves
2017-05-19 13:20       ` Eli Zaretskii
2017-05-19 13:26         ` Rainer Orth
2017-05-19 13:43           ` Pedro Alves
2017-05-19 13:39         ` Pedro Alves [this message]

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=f8bb369c-e9e1-755b-ddf5-5dd2d142bab9@redhat.com \
    --to=palves@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ro@CeBiTec.Uni-Bielefeld.DE \
    /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