Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang compiler : missing include header #39

Open
juno-devel opened this issue Oct 8, 2023 · 0 comments
Open

clang compiler : missing include header #39

juno-devel opened this issue Oct 8, 2023 · 0 comments

Comments

@juno-devel
Copy link

juno-devel commented Oct 8, 2023

Just to share my experience, hope it will help someone, great and useful lib, so here it is ...

Testbed :

Debian clang version 16.0.6 (15)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Icecream : from master

Add #include <cstdarg> in icecream.hpp in order to avoid these following errors caused by this statement in mytest.cxx

using icecream::f_;

In file included from mytest.cxx:8:
./icecream.hpp:1613:58: error: unexpected type name 'T0': expected expression
            result.push_back(static_cast<T>(va_arg(args, T0)));
                                                         ^
./icecream.hpp:1628:38: error: expected '(' for function-style cast or type construction
            auto v = va_arg(args, int) & 0x01;
                                  ~~~^
./icecream.hpp:1647:43: error: expected '(' for function-style cast or type construction
            double d = va_arg(args, double);
                                    ~~~~~~^
./icecream.hpp:1674:41: error: unexpected type name 'T0': expected expression
        return Tree{(T)(T1)va_arg(args, T0), std::move(buf_)};
                                        ^
./icecream.hpp:1680:34: error: expected '(' for function-style cast or type construction
        auto i = va_arg(args, int) & 0x01;
                              ~~~^
./icecream.hpp:1694:37: error: expected '(' for function-style cast or type construction
        auto d = va_arg(args, double);
                              ~~~~~~^
./icecream.hpp:1873:9: error: use of undeclared identifier 'va_start'
        va_start(args, format);
        ^
./icecream.hpp:1926:9: error: use of undeclared identifier 'va_end'
        va_end(args);

GCC is more permissive and seems to ignore this ...

gcc (Debian 13.2.0-4) 13.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant