System / language / version incompatibilities?

Hi,

I just installed v6-08-06 in Ubuntu 16.04. Some simple Root scripts that I’ve used before
exhibit several incompatibilities, for example "variable length array declaration not allowed"
or “[switch] statement requires expression of integer type”.

I get the feeling that this is related to specific C versions or something along those lines, but I can’t pin it down. Could you help me understand what changes I should make to my system?

Best regards

This is most likely due to code that was previously allowed even though it was not following the rules correctly. The newer compiler / interpreter is more strict and is enforcing the rules. The solution is to bring your code up to the standard, this could be painful depending on the number of corrections that need to be made, but ensures that the code performs as expected.

If you want help on the details you will need to post an example with the errors.

For variable length arrays see the following from http://www.cplusplus.com/doc/tutorial/arrays/

One solution for variable arrays is using a std::vector (preferred) or doing something like the follwing:

int size = 100;
float *array = new float[size];

For switch statements see the following from http://www.cplusplus.com/doc/tutorial/control/

2 Likes

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