public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH 2/2] Move source files used in utils/mingw/ into that subdirectory
Date: Mon, 10 May 2021 09:51:40 +0200	[thread overview]
Message-ID: <YJjmDHgz2aAEon03@calimero.vinschen.de> (raw)
In-Reply-To: <e95edb29-3a56-70d5-be45-ce68ffec9f0d@dronecode.org.uk>

On May  9 16:16, Jon Turney wrote:
> On 06/05/2021 09:43, Corinna Vinschen wrote:
> > On May  4 19:34, Jon Turney wrote:
> > > On 03/05/2021 11:48, Corinna Vinschen wrote:
> > > > What about adding -I../../cygwin -I../../cygwin/include to the build
> > > > rules and get rid of the relative paths inside the sources?
> > > 
> > > That seems fraught as it allows cygwin system headers to be picked up in
> > > preference to mingw ones?
> > > 
> > > Using '-idirafter' gets you a build, but it would be much more work to check
> > > that you've actually built what you wanted to...
> > 
> > Well, ok.  It just looks *so* ugly...  What about at least
> > 
> >    --idirafter ../../cygwin
> > 
> > and then
> > 
> >        #include "include/sys/strace.h"
> >        #include "include/sys/cygwin.h"
> >        #include "include/cygwin/version.h"
> >        #include "cygtls_padsize.h"
> >        #include "gcc_seh.h"
> > That would disallow picking up system headers and still be a bit
> > cleaner, no?
> 
> After thinking about this a bit more, I'm fairly certain that using
> -idirafter with both paths gets us the same build as before, so I've posted
> a patch with that change.
> 
> However, as written it's still a bit dangerous: any includes of system
> headers by those files included from winsup/cygwin will be getting MinGW
> system headers. I don't think that e.g. the value of ULONG_MAX is going be
> used by any of those, but there is a theoretical risk of them not getting
> what is expected...
> 
> Perhaps the only safe way to write this is to put the numeric constants
> which strace uses into a separate header.

That sounds like a really good idea.


Corinna

  reply	other threads:[~2021-05-10  7:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02 15:25 [PATCH 0/2] Improve automake object file location for utils/mingw/ Jon Turney
2021-05-02 15:25 ` [PATCH 1/2] Unpick cygpath TESTSUITE Jon Turney
2021-05-02 15:25 ` [PATCH 2/2] Move source files used in utils/mingw/ into that subdirectory Jon Turney
2021-05-03 10:48   ` Corinna Vinschen
2021-05-04 18:34     ` Jon Turney
2021-05-06  8:43       ` Corinna Vinschen
2021-05-09 15:16         ` Jon Turney
2021-05-10  7:51           ` Corinna Vinschen [this message]
2021-05-09 15:09 ` [PATCH 3/2] Get rid of relative include paths in strace.cc Jon Turney
2021-05-10  8:09   ` Corinna Vinschen

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=YJjmDHgz2aAEon03@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /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).