You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In situations where the same function is referenced in multiple files, ferret code generation can result in the function definitions being included multiple times. In the following example the bar function is called directly in main, and also indirectly via the foo function:
If you compile main.clj with ferret, it will emit a .cpp file with multiple definitions of the bar function. Trying to compile that .cpp file will result in these errors:
src/main.cpp:2537:7: error: redefinition of 'class main::bar_bar'
class bar_bar {
^~~~~~~
src/main.cpp:2527:7: note: previous definition of 'class main::bar_bar'
class bar_bar {
^~~~~~~
src/main.cpp:2564:12: error: redefinition of 'ferret::var main::bar_bar::invoke(ferret::ref) const'
inline var bar_bar::invoke(ref _args_) const {
^~~~~~~
src/main.cpp:2551:12: note: 'ferret::var main::bar_bar::invoke(ferret::ref) const' previously defined here
inline var bar_bar::invoke(ref _args_) const {
^~~~~~~
The text was updated successfully, but these errors were encountered:
esp1
changed the title
Code generation can result in functions being include more than once
Code generation can result in functions being included more than once
Feb 23, 2023
In situations where the same function is referenced in multiple files, ferret code generation can result in the function definitions being included multiple times. In the following example the
bar
function is called directly inmain
, and also indirectly via thefoo
function:main.clj:
foo.clj:
bar.clj
If you compile main.clj with ferret, it will emit a .cpp file with multiple definitions of the
bar
function. Trying to compile that .cpp file will result in these errors:The text was updated successfully, but these errors were encountered: