In GNU C Library, /usr/include/sys/wait.h defines __WAIT_STATUS as
__attribute__((__transparent_union__)) if __GNUC__ is defined.
(Otherwise it's void *.) As a result, if a program calls wait, clang
currently errors with "incompatible types".
Other than this and too verbose format string warnings, All of Tcl 6.4
(very old version, but build system is simple Makefile without any
automagics) compiles, including -emit-llvm. Whether the result is
correct is unknown, but Tcl has a complete test suite.
In GNU C Library, /usr/include/sys/wait.h defines __WAIT_STATUS as
__attribute__((__transparent_union__)) if __GNUC__ is defined.
(Otherwise it's void *.) As a result, if a program calls wait, clang
currently errors with "incompatible types".
Other than this and too verbose format string warnings, All of Tcl 6.4
(very old version, but build system is simple Makefile without any
automagics) compiles, including -emit-llvm. Whether the result is
correct is unknown, but Tcl has a complete test suite.
This is great news.
Thanks for the clear/concise bug reports and patches,
snaroff
Hi Sanghyeon,
I am curious to get your opinion on the format string warnings. GCC by default does not emit similar warnings without a special flag. Although the warnings issued for Tcl might actually be genuine (I myself will take a look at the warnings for Tcl sometime this week to see if they are real), the real question is whether or not you want to see them always emitted by default. The intention of making these warnings on by default in clang is to encourage better programming by warning of dangerous or deprecated API usage, but I wonder if this makes sense in all cases, especially when compiling a third-party code base. Currently, we don't have a comprehensive scheme of when we should issue such warnings which are auxiliary to standard parsing and type system errors, and we are evolving this scheme over time as the driver is used.
So I guess for the format string warnings, would you (and others) prefer that they were *not* on by default, and like GCC, require a special flag to the driver for them to be emitted?
Ted
In GNU C Library, /usr/include/sys/wait.h defines __WAIT_STATUS as
__attribute__((__transparent_union__)) if __GNUC__ is defined.
(Otherwise it's void *.) As a result, if a program calls wait, clang
currently errors with "incompatible types".
Ok, this means we need to capture the transparent union attribute in the AST. There is going to be some work (probably after the holidays) to restructure how we represent attributes in the AST. I think it's reasonable to wait until this happens.
Once we have the attribute in the AST, we'll need to change the type checker and the code generator to handle this properly (__transparent_union__ is an ugly hack!).
Can you please file a bugzilla for this one to track it?
Other than this and too verbose format string warnings, All of Tcl 6.4
(very old version, but build system is simple Makefile without any
automagics) compiles, including -emit-llvm. Whether the result is
correct is unknown, but Tcl has a complete test suite.
Woo, excellent!
-Chris
Hello,
Chris Lattner wrote:
In GNU C Library, /usr/include/sys/wait.h defines __WAIT_STATUS as
__attribute__((__transparent_union__)) if __GNUC__ is defined.
(Otherwise it's void *.) As a result, if a program calls wait, clang
currently errors with "incompatible types".
[SNIP]
Can you please file a bugzilla for this one to track it?
Nuno Lopes has submitted a bug for this:
http://llvm.org/bugs/show_bug.cgi?id=2015
I also ran into this issue when compiling Wireshark.