Coder Social home page Coder Social logo

naming conflict about catch2 HOT 7 CLOSED

catchorg avatar catchorg commented on May 21, 2024
naming conflict

from catch2.

Comments (7)

philsquared avatar philsquared commented on May 21, 2024

Hi Wichert,

AFAIK all local variables that Catch uses have fairly obfuscated names (for exactly this reason) - usually including a catch based prefix and line number too. Obviously if I've missed any I'd like to know about it (and fix it).

Could you try and boil your case down to the smallest thing that demonstrates the problem and post it here.

Thanks for the feedback.

from catch2.

philsquared avatar philsquared commented on May 21, 2024

Actually I just had a feeling I might know where the variable you're talking about might be. Had a quick look and, sure enough, there it is. It's in a scope entirely controlled by Catch, so technically it is safe.
However I can see why it produces the warning you're seeing. Not sure why it might make your tests fail, though.

I'll push a fix up later today.

Thanks again for letting me know.

from catch2.

philsquared avatar philsquared commented on May 21, 2024

I checked in that change. There were actually three undecorated names that I found (incuding 'action'). All should have been safely within inner-scopes - but at least for the sake of warnings I've now prefixed them.
Please let me know if this fixes the issue for you.
However, if you did manage to get a boiled down example of it causing a test to fail I'd still be very interested to know - not least so I could add it to the self-test suite.

from catch2.

wichert avatar wichert commented on May 21, 2024

I'll try later this week. A somewhat related question: when moving to
the latest catch version it is attractive to use the single-include
method, but I didn't see any documentation on how to do the equivalent
of using catch_with_main.hpp vs catch.hpp using it. Can you add that to
the documetation?

Wichert Akkerman [email protected] It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.

from catch2.

philsquared avatar philsquared commented on May 21, 2024

The docs need an overhaul + extending (the latter being the main reason for the former!).
But the single-header related stuff is pretty important so, thanks to your prompting, I've made a small update to reflect that.

from catch2.

philsquared avatar philsquared commented on May 21, 2024

Hi @wichert - have you had a chance to verify this fix (and the docs)?

from catch2.

philsquared avatar philsquared commented on May 21, 2024

I'm going to close this issue for now as my own view is that the issue is resolved. If you see any other name clashes please reopen (is that even possible with GitHub's system?) or just log a new issue.

Thanks again for reporting it.

from catch2.

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.