Problem building libstdc++ for the avr target
Jonathan Wakely
jwakely@redhat.com
Tue Feb 9 10:47:56 GMT 2021
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