On Thu, Jun 11, 2015 at 8:35 AM, Hans-Werner Hilse <hwhi...@gmail.com> wrote: > Hi, > > Am 2015-06-10 23:37, schrieb Richard Weinberger: >> On Wed, Jun 10, 2015 at 11:21 PM, Hans-Werner Hilse <hwhi...@gmail.com> >> wrote: >>> Naming local variables "stdin" and "stdout" is fine with glibc, >>> other C libraries, namely musl, will however complain. >> >> Wait, what?! >> These are not local variables, they are struct members. >> >> What exactly is the issue with musl? Sounds very odd. > > They chose to have stdin and stdout (and, of course, stderr) wrapped in > macros - in a different way than glibc: > > [...] > extern FILE *const stdin; > [...] > #define stdin (stdin) > > (http://git.musl-libc.org/cgit/musl/tree/include/stdio.h?id=v1.1.10#n59) > > The C standards C89/C99 (the last one I even looked up right now) say > those identifiers are macros - according to stdio.h from glibc, which > does the following: > > /* Standard streams. */ > extern struct _IO_FILE *stdin; /* Standard input stream. */ > [...] > /* C89/C99 say they're macros. Make them happy. */ > #define stdin stdin > [...] > > Of course you're right, of course they are struct members. That's what I > get for writing my commit messages too long after going at the issue at > hand. > > I'll send an updated patch series in a few minutes.
Slow down a bit. Since when is it forbidden to name something "stdin" in a C program? Does the standard say that? If yes, where? We have to sort this out. If UML violates a rule, we have to fix it. But maybe musl needs fixing... -- Thanks, //richard ------------------------------------------------------------------------------ _______________________________________________ User-mode-linux-devel mailing list User-mode-linux-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel