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

GCC 14 emits extra warnings #698

Closed
Vekhir opened this issue May 20, 2024 · 1 comment
Closed

GCC 14 emits extra warnings #698

Vekhir opened this issue May 20, 2024 · 1 comment

Comments

@Vekhir
Copy link
Contributor

Vekhir commented May 20, 2024

Hi,
when linking a BSV project using bsc and Bluesim with GCC 14.1, the following warning occurs in several places:

In file included from /opt/bluespec/lib/Bluesim/bluesim_primitives.h:6,
                 from ./model_mkFibOne.cxx:7:
/opt/bluespec/lib/Bluesim/bs_prim_mod_reg.h:22:14: warning: template-id not allowed for constructor in C++20 [-Wtemplate-id-cdtor]
   22 |   MOD_Reg<T>(tSimStateHdl simHdl, const char* name, Module* parent,
      |              ^~~~~~~~~~~~
/opt/bluespec/lib/Bluesim/bs_prim_mod_reg.h:22:14: note: remove the ‘< >’

Description

BDW provides for development two modes for compilation/simulation: Bluesim and Verilog. The Verilog mode works fine, the Bluesim mode however emits above warnings (and produces a binary which doesn't run, but that's a separate issue).

Steps to reproduce

  1. Copy examples/smoke_test/FibOne.bsv into a local directory.
  2. Run bsc -u -sim -simdir . -bdir . -info-dir . -keep-fires -p %/Libraries -g mkFibOne FibOne.bsv
  3. Run bsc -e mkFibOne -sim -o ./out -simdir . -p %/Libraries -bdir . -keep-fires

These warnings also lead to test failures when running make check whereever the output is tested. Afaict, the failing tests are all affected by this mismatch.
They also show this warning:

Bluesim object created: model_mkTbGCD.{h,o}
../../../../src/bluesim/event_queue.cxx:8:24: warning: ‘bk_clock_name’ violates the C++ One Definition Rule [-Wodr]
    8 | extern "C" const char* bk_clock_name(tClock handle);
      |                        ^
../../../../src/bluesim/kernel.cxx:1093:13: note: type mismatch in parameter 1
 1093 | const char* bk_clock_name(tSimStateHdl simHdl, tClock clk)
      |             ^
../../../../src/bluesim/kernel.cxx:1093:13: note: type ‘struct tSimState *’ should match type ‘tClock’
../../../../src/bluesim/kernel.cxx:1093:13: note: ‘bk_clock_name’ was previously declared here
../../../../src/bluesim/kernel.cxx:1093:13: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

System information

Full logs

warnings.log
tests.log

@quark17
Copy link
Collaborator

quark17 commented May 27, 2024

Thank you for reporting this! PR #701 (that has just been merged) should fix the template-id warnings, that you mention first. I will also file a PR for the second warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants