![]() | unity_fixture.h macros???, GCC differences to (VC++ and Softune) |
|
30 Nov 2011, 17:13
Anders Eriksson (2 posts) |
Hello, Thank you for an excellent book, I am now reading and testing at the same time. I am using VC++ 2008 Express for testing the CppUTest works fine! but when I am trying the Unity I get compile errors both on my target (softune compiler for a Fujitsu mcu) and in VC++ I have found out that GCC accepts a function declaration just before a call to the declared function inside another function, see below:
To get this to work in VC++ and Softune, I had to move out the 2 function declarations above the function. Perhaps I have missed to set some compiler switches to allow these declarations or what am I doing wrong? Kind regards |
|
30 Nov 2011, 17:11
Anders Eriksson (2 posts) |
Hello again! Now I have come up with a fix that is working in VC++ and Softune but NOT in GCC :( I have changed the following in unity_fixture.h:
Does anyone know why there is this difference between GCC and VC++ (and this new macro works also in Softune)? Kind regards |
|
07 Dec 2011, 14:41
James Grenning (130 posts) |
That is odd. Though the VS compilers are converging on the standard. VS2010 might be more compatible. |
|
16 Jan 2013, 18:31
James Hood (1 post) |
Hi James, Big fan! I’m trying to port the examples supplied in the Unity distribution to use your unity_fixture from extras in Visual Studio 2010 Professional and I’m getting the same error. :/ The changes above fixed my problem as well. Any suggestions on how to make this work across the platforms? I’d be willing to submit a pull request to Unity, but I’m not sure the best way to solve the incompatibility. To be honest I don’t think I understand the incompatibility :) Thanks in advance for your thoughts / advice! |
| You must be logged in to comment |

