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

Nameclash for STATE y. #2658

Open
1uc opened this issue Jan 10, 2024 · 1 comment
Open

Nameclash for STATE y. #2658

1uc opened this issue Jan 10, 2024 · 1 comment

Comments

@1uc
Copy link
Collaborator

1uc commented Jan 10, 2024

The following MOD file

NEURON {
    SUFFIX leonhard
}

STATE {
  y
}

INITIAL {
    y = 42.0
}

BREAKPOINT {
    SOLVE dX METHOD cnexp
}

DERIVATIVE dX {
    y' = -y
}

fails to compile with the following error:

$ nrnivmodl
 -> Compiling leonhard.cpp
leonhard.cpp:120:16: error: ‘double y0’ redeclared as different kind of entity
  120 |  static double y0 = 0;
      |                ^~
In file included from /usr/include/features.h:503,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from leonhard.cpp:4:
/usr/include/bits/mathcalls.h:223:1: note: previous declaration ‘double y0(double)’
  223 | __MATHCALL (y0,, (_Mdouble_));
      | ^~~~~~~~~~

with nrnivmodl from neuron-nightly.

Is this expected or a recent regression?

@1uc 1uc changed the title Nameclash for STATE y. Nameclash for STATE y. Jan 10, 2024
1uc added a commit to BlueBrain/nmodl that referenced this issue Jan 10, 2024
@alkino
Copy link
Member

alkino commented Jan 10, 2024

So, no idea, only adding informations about this first y0.

mathcalls.h is owned by glibc.

And the comment tells this is for bessel functions:

#if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE)
/* Bessel functions.  */
__MATHCALL (j0,, (_Mdouble_));
__MATHCALL (j1,, (_Mdouble_));
__MATHCALL (jn,, (int, _Mdouble_));
__MATHCALL (y0,, (_Mdouble_));
__MATHCALL (y1,, (_Mdouble_));
__MATHCALL (yn,, (int, _Mdouble_));
#endif

Here is the documentation for this function
https://man.archlinux.org/man/y0.3.en

This is a POSIX function.

1uc added a commit to BlueBrain/nmodl that referenced this issue Jan 10, 2024
1uc added a commit to BlueBrain/nmodl that referenced this issue Jan 11, 2024
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