Name for global variables

Hi Everyone,

I was trying to do something else when I found I can’t define a variable y1 when using the interpreter. I tried this:

root[0] Int_t y1

And it gave me an entire crash in root6.02 and a gentle reminder on 6.13:

root [0] Int_t y1
ROOT_prompt_0:1:7: error: redefinition of 'y1' as different kind of symbol
Int_t y1
      ^
/usr/include/*/bits/mathcalls.h:251:13: note: previous definition is here
__MATHCALL (y1,, (_Mdouble_));

It looks for me that this is a very standard way to define a variable (y1), so I don’t really know if there is something wrong in using it or perhaps it is bug (calling a global variable as y1 is not quite right in my point of view :sweat_smile:).

Regarding a similar problem a couple of months ago I posted something about defining a variable as “rand” in which @eguiraud created a JIRA ticket to change the name of those variables in the tutorials. The bug has not been fixed and still causes on-line tutorials examples to fail here. Maybe I shouldn’t reefer to this because it is old documentation? Nevertheless, I made a pull request not being sure if this is a propper solution to the problem. Aside question: Does ROOT have a plan to use github issues system in the near future?

Hi,

as @eguiraud stressed in the other thread, these variables are already defined in the stl and can be used in macros, but not at the prompt.
For what concerns the usage of the GH issue tracking system instead of JIRA, I think no switch is foreseen in the near future.

Cheers,
D

Thank you @Danilo. I understand what you’re saying, it looks like Pere submitted a fix for that issue at the same time as me :smile:. By the way, a function called y1 in a global scope don’t look like a good practice. Is it possible to get a list of those reserved names?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.