Giter Club home page Giter Club logo

Comments (9)

GibbOne avatar GibbOne commented on August 21, 2024 1

@matu3ba I already showed MSVC compiler version on my last post. Look at picture of console.

from tau.

jasmcaus avatar jasmcaus commented on August 21, 2024

@GibbOne I ran this locally, and it seems to work:

image

Try this in a test file:

#include <tau/tau.h>
TAU_MAIN()

TEST(TAU, ItShouldFailWithMessage)
{
    CHECK(0);                           // this check fails correctly.
    CHECK(0, "It should FAIL");         // this check doesn't fail.
}

from tau.

GibbOne avatar GibbOne commented on August 21, 2024

@jasmcaus if I use gcc it works like you did. But if I use MSVC, it doesn't.

image

from tau.

jasmcaus avatar jasmcaus commented on August 21, 2024

@GibbOne See this. Only MSVC 2017 seems to fail. Not sure why. I don't have a Windows machine w/ me so it's quite hard for me to explore this. Would you mind taking a look and opening a PR with your changes?

from tau.

jasmcaus avatar jasmcaus commented on August 21, 2024

@matu3ba maybe you could have a look at this as well?

from tau.

matu3ba avatar matu3ba commented on August 21, 2024

Let me spin up Windows in a WM to see, if I can reproduce.

// file t1.c
#include <tau/tau.h>
TAU_MAIN()

TEST(TAU, ItShouldFailWithMessage)
{
    CHECK(0);                           // this check fails correctly.
    //CHECK(0, "It should FAIL");         // this check doesn't fail.
}

// file t2.c
#include <tau/tau.h>
TAU_MAIN()

TEST(TAU, ItShouldFailWithMessage)
{
    //CHECK(0);                           // this check fails correctly.
    CHECK(0, "It should FAIL");         // this check doesn't fail.
}

// windows cmds:
// cl /I . t1.c -o t1
// cl /I . t2.c -o t2
// linux (works)
// gcc -I . test.c -o t1 && ./t1
// gcc -I . test.c -o t2 && ./t2

from tau.

matu3ba avatar matu3ba commented on August 21, 2024

@GibbOne Please always provide version numbers for the compiler version.

On the latest? release 19.13.31105 I get with cl /I tau t1.c with t1.c having the following content:

// file t1.c
#include <tau/tau.h>
TAU_MAIN()

TEST(TAU, ItShouldFailWithMessage)
{
    CHECK(0);      // this check fails correctly.
    //CHECK(0, "It should FAIL");           // this check doesn't fail.
}

the following error:

tau\tau/misc.h(34): fatal error C1083: Cannot open include fils: 'inttypes.h': No such file or directory.

So to me it looks like tau is broken on MSVC.

from tau.

matu3ba avatar matu3ba commented on August 21, 2024

@GibbOne My bad.

At least this post indicates that Microsoft only guarantees compatibility via their libraries.
https://stackoverflow.com/questions/41975672/abi-compatibility-of-visual-studio-c-libraries

A proper fix would probably require https://stackoverflow.com/questions/9233118/library-abi-compatibility-between-versions-of-visual-studio with https://github.com/lvc/abi-compliance-checker to figure out what is broken,
since unfortunately Microsoft does not generate reports what stuff they broke how and when.

from tau.

GibbOne avatar GibbOne commented on August 21, 2024

I solved by adding /Zc:preprocessor compiler option.

See https://stackoverflow.com/a/5134656/6539880 and https://docs.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-170.

from tau.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.