Skip to content

API argument changes break Verilator libfst usage #12

@wsnyder

Description

@wsnyder

@rfuest commit 75ef3d0 seems to break Verilator's usage of the API. Perhaps this is because Verilator compiles it under C++ with strong warnings.

To reproduce, follow instructions in https://github.com/verilator/verilator_ext_tests

and run

 make pull   #  Updates submodules/libfst 
 t/t_libfst_diff.py --gold   # Copy libfst into verilator's include/libfst
 t/t_trace_enum_fst.py
 # or make test

Alternatively setup a verilator checkout as described in the verilator docs https://verilator.org/guide/latest/install.html, copy the libfst files into include/gtkwave manually, and run "make test".

Some example errors:

In file included from /verilator/include/verilated_fst_c.cpp:37:
/verilator/include/gtkwave/fstapi.c: In function â\200\230void fstWriterFlushContextPrivate(fstWriterContext*)â\200\231:
/verilator/include/gtkwave/fstapi.c:1831:55: error: invalid conversion from â\200\230void* (*)(fstWriterContext*)â\200\231 to â\200\230void* (*)(void*)â\200\231 $
 1831 |         pthread_create(&xc->thread, &xc->thread_attr, fstWriterFlushContextPrivate1, xc2);
      |                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                       |
      |                                                       void* (*)(fstWriterContext*)
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/gthr.h:148,
                 from /usr/include/c++/11/ext/atomicity.h:35,
                 from /usr/include/c++/11/bits/basic_string.h:39,
                 from /usr/include/c++/11/string:55,
                 from /verilator/include/verilatedos.h:628,
                 from /verilator/include/verilated.h:42,
                 from /verilator/include/verilated_fst_c.cpp:26:
/usr/include/pthread.h:204:36: note:   initializing argument 3 of â\200\230int pthread_create(pthread_t*, const pthread_attr_t*, void* (*)(void*), void*)â\200\23$
  204 |                            void *(*__start_routine) (void *),
      |                            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/verilator/include/verilated_fst_c.cpp: In destructor â\200\230VerilatedFst::~VerilatedFst()â\200\231:
/verilator/include/verilated_fst_c.cpp:74:31: error: invalid conversion from â\200\230void*â\200\231 to â\200\230fstWriterContext*â\200\231 [-fpermissive]
   74 |     if (m_fst) fstWriterClose(m_fst);
      |                               ^~~~~
      |                               |
      |                               void*
In file included from /verilator/include/verilated_fst_c.cpp:37:
/verilator/include/gtkwave/fstapi.c:1860:39: note:   initializing argument 1 of â\200\230void fstWriterClose(fstWriterContext*)â\200\231
 1860 | void fstWriterClose(fstWriterContext *xc)
      |                     ~~~~~~~~~~~~~~~~~~^~
/verilator/include/verilated_fst_c.cpp: In member function â\200\230void VerilatedFst::open(const char*)â\200\231:
/verilator/include/verilated_fst_c.cpp:82:26: error: invalid conversion from â\200\230void*â\200\231 to â\200\230fstWriterContext*â\200\231 [-fpermissive]
   82 |     fstWriterSetPackType(m_fst, FST_WR_PT_LZ4);
      |                          ^~~~~
      |                          |
      |                          void*
In file included from /verilator/include/verilated_fst_c.cpp:37:
/verilator/include/gtkwave/fstapi.c:2460:45: note:   initializing argument 1 of â\200\230void fstWriterSetPackType(fstWriterContext*, fstWriterPackType)â\200\231
 2460 | void fstWriterSetPackType(fstWriterContext *xc, enum fstWriterPackType typ)
      |                           ~~~~~~~~~~~~~~~~~~^~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions