Problem building libstdc++ for the avr target
Vladimir V
vv.os.swe@gmail.com
Tue Feb 9 10:54:49 GMT 2021
Thank you for the review.
> My best guess is that it is there because that file previously used
> lstat and the linux lstat(2) man page (IMHO incorrectly) says that
> <unistd.h> is needed.
I got the same feeling as well.
вт, 9 февр. 2021 г. в 11:48, Jonathan Wakely <jwakely@redhat.com>:
> On 08/02/21 23:25 +0100, Vladimir V wrote:
> >Thank you for the reply.
> >
> >>> I don't see why this file includes <unistd.h>, it doesn't *seem* to
> >>> need it. Even if it's needed, the correct way to include it is:
> >
> >So it was there since the initial commit but during my quick walk through
> >the history
> >I didn't find what API from <unistd.h> was used.
>
> My best guess is that it is there because that file previously used
> lstat and the linux lstat(2) man page (IMHO incorrectly) says that
> <unistd.h> is needed.
>
> >So, in the patch I just deleted the include but as Keith suggested it can
> >affect the client code.
> >If the policy is:
> >
> >>> We routinely remove such transitive includes. Any code assuming that
> >>> <fstream> defines the contents of <unistd.h> is wrong and should be
> >>> fixed.
> >
> >then I would keep it like that.
> >Or would it be better to update the patch to move it inside the guard?
>
> I will commit your patch unchanged. In practice it is unlikely to
> affect anybody, because that header is only used when compiling
> libstdc++ itself. I don't see any code in the Debian archives using it
> except for GCC itself and one testcase in the Clang repo.
>
>
>
More information about the Libstdc++
mailing list