Sitelet https://web.archive.org/web/20201207081558/https://github.com/cpputest/cpputest/issues/1193
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

IAR 8.1 CppUTest fails to build #1193

Open
nowox opened this issue Jan 11, 2019 · 2 comments
Open

IAR 8.1 CppUTest fails to build #1193

nowox opened this issue Jan 11, 2019 · 2 comments
Labels
bug

Comments

@nowox
Copy link

@nowox nowox commented Jan 11, 2019

The project cpputest\platforms\iar\CppUTest.eww fails to build with IAR 8.1:

CommandLineArguments.cpp  
Error[Pe135]: namespace "std" (declared at line 185 of "C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.1\arm\inc\c\yvals.h") has no member "nullptr_t" cpputest\include\CppUTest\SimpleString.h 182 
Error while running C/C++ Compiler 

I have added cstddef as preinclude:

Preinclude file: 
C:\Program Files (x86)\IAR Systems\Embedded Workbench 8.1\arm\inc\cpp\cstddef

But then I have these errors:

Error[Pe079]: expected a type specifier cpputest\src\CppUTest\SimpleString.cpp 548 
Warning[Pe815]: type qualifier on return type is meaningless cpputest\src\CppUTest\SimpleString.cpp 548 
Error[Pe018]: expected a ")" cpputest\src\CppUTest\SimpleString.cpp 548 
Error while running C/C++ Compiler 

Which occur here:

#if __cplusplus > 199711L && !defined __arm__
SimpleString StringFrom(const std::nullptr_t __attribute__((unused)) value)
{
    return "(null)";
}

It seems neither __arm__ nor __cplusplus is defined. So I added them as defines. I also disabled the exceptions because the library is meant to be used on embedded devices.

CPPUTEST_STD_CPP_LIB_DISABLED=1
__arm__
__cplusplus=200000L

This time the project builds without errors

@watersne
Copy link

@watersne watersne commented Nov 22, 2019 •

IAR's compiler guide for 8.10 claims __cplusplus=199711L is defined, but I am seeing that __cplusplus is actually 201402L on my system. IARs docs are out of date. To get past this I had to add !defined __ICCARM__ to that line. That feels like a hack.

Edit: That builds, but it certainly doesn't work. I run into memory allocation failures that crash my simulator.

@basvodde
Copy link
Member

@basvodde basvodde commented May 19, 2020

I think that this has been resolved? Can you confirm that?

Is there any reasonable way to get the IAR build in the travis CI?

@basvodde basvodde added the bug label May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.