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

Verilator compares this to null which is not valid c++ #1030

Closed
veripoolbot opened this issue Feb 1, 2016 · 4 comments
Closed

Verilator compares this to null which is not valid c++ #1030

veripoolbot opened this issue Feb 1, 2016 · 4 comments
Assignees
Labels
area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Johan Bjork
Original Redmine Issue: 1030 from https://www.veripool.org
Original Date: 2016-02-01
Original Assignee: Wilson Snyder (@wsnyder)


share/verilator/include/verilated.h:208:19: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
if (VL_UNLIKELY(!this)) return exportFindNullError(funcnum);
                 ~^~~~

Additionally there are also multiple places in V3Ast.cpp.

clang recently started warning about this, and it seems future versions will optimize away this check completely.

more info for example here: https://code.google.com/p/chromium/issues/detail?id=403594

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-02-03T00:35:49Z


Working through these. Pushed fixing include's to trunk, so now verilated files are clean.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-02-09T03:32:01Z


I've committed all I'm going to fix for the time being, so will call this resolved for now as clang no longer will complain and the verilated output code is completely clean. I did some research, and while a NULL->method call certainly violates the standards, all known compilers allow this behavior and it's very rampant in other's code so I suspect they will continue to. So at this point I can't justify changing almost every cast and iterator in the program. If g++ or clang breaks down the road, please file another bug and I'll get back to it.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Johan Bjork
Original Date: 2016-02-09T13:54:00Z


Sounds good to me. Thanks!

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2016-03-02T00:17:20Z


In 3.882 (to the extent described above).

@veripoolbot veripoolbot added area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: fixed Closed; fixed labels Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: configure/compiling Issue involves configuring or compilating Verilator itself resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants