Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Jun 2022 13:39:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        toolchain@FreeBSD.org
Subject:   [Bug 264730] clang++ -fmodules fails when using stdout from cstdio: error: declaration of '__stdoutp' must be imported from module 'std.iosfwd' before it is required
Message-ID:  <bug-264730-29464-NnRMUU5Ct4@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-264730-29464@https.bugs.freebsd.org/bugzilla/>
References:  <bug-264730-29464@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D264730

Dimitry Andric <dim@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dim@FreeBSD.org

--- Comment #1 from Dimitry Andric <dim@FreeBSD.org> ---
I'm unsure why -fmodules changes this behavior, but __stdoutp is declared in
/usr/include/stdio.h, like:

#ifndef _STDSTREAM_DECLARED
__BEGIN_DECLS
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
__END_DECLS
#define _STDSTREAM_DECLARED
#endif

while there is a similar, but slightly different declaration in
/usr/include/wchar.h:

#ifndef _STDSTREAM_DECLARED
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
#define _STDSTREAM_DECLARED
#endif

Though in this file, __BEGIN_DECLS is at the top, and __END_DECLS at the
bottom.

libc++'s <cstdio.h> begins by including <__config>, and then <stdio.h>. I
suspect the former is pulling in <wchar.h>, or something like that?

On the other hand, you might be the very first person to ever try modules on
FreeBSD. There are likely some bumps in the road. :)

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-264730-29464-NnRMUU5Ct4>