public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix libstdc++ lstat missing return type for Windows target
@ 2019-08-23 13:20 Joseph Myers
  2019-08-23 20:41 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2019-08-23 13:20 UTC (permalink / raw)
  To: gcc-patches, libstdc++

Building for i686-mingw32 target (with some local changes) produced an
error

error: ISO C++ forbids declaration of 'lstat' with no type [-fpermissive]

in libstdc++-v3/src/filesystem/ops-common.h.  This patch adds the
missing return type.  OK to commit (trunk and GCC 9 branch)?

Note 1: I haven't run the testsuite with this patch, but it fixes the
build failure I see (in sources with other local changes).

Note 2: I don't know why this hasn't produced build failures for other
people, but the missing return type looks wrong in any case even if
other local changes are for some reason needed for it to produce an
error.

2019-08-23  Joseph Myers  <joseph@codesourcery.com>

	* src/filesystem/ops-common.h [_GLIBCXX_FILESYSTEM_IS_WINDOWS]
	(std::filesystem::__gnu_posix::lstat): Add return type.

Index: libstdc++-v3/src/filesystem/ops-common.h
===================================================================
--- libstdc++-v3/src/filesystem/ops-common.h	(revision 274854)
+++ libstdc++-v3/src/filesystem/ops-common.h	(working copy)
@@ -76,7 +76,7 @@
   inline int stat(const wchar_t* path, stat_type* buffer)
   { return ::_wstat(path, buffer); }
 
-  inline lstat(const wchar_t* path, stat_type* buffer)
+  inline int lstat(const wchar_t* path, stat_type* buffer)
   {
     // TODO symlinks not currently supported
     return stat(path, buffer);

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fix libstdc++ lstat missing return type for Windows target
  2019-08-23 13:20 Fix libstdc++ lstat missing return type for Windows target Joseph Myers
@ 2019-08-23 20:41 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2019-08-23 20:41 UTC (permalink / raw)
  To: Joseph Myers; +Cc: gcc-patches, libstdc++

On Fri, 23 Aug 2019 at 14:20, Joseph Myers <joseph@codesourcery.com> wrote:
>
> Building for i686-mingw32 target (with some local changes) produced an
> error
>
> error: ISO C++ forbids declaration of 'lstat' with no type [-fpermissive]
>
> in libstdc++-v3/src/filesystem/ops-common.h.  This patch adds the
> missing return type.  OK to commit (trunk and GCC 9 branch)?

Yes, OK for trunk and gcc-9-branch. Thanks.

> Note 1: I haven't run the testsuite with this patch, but it fixes the
> build failure I see (in sources with other local changes).
>
> Note 2: I don't know why this hasn't produced build failures for other
> people, but the missing return type looks wrong in any case even if
> other local changes are for some reason needed for it to produce an
> error.

Yes, it's odd that it builds for x86_64-w32-mingw32.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-08-23 20:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-23 13:20 Fix libstdc++ lstat missing return type for Windows target Joseph Myers
2019-08-23 20:41 ` Jonathan Wakely

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).