Two small issues with getARGV

Hello
Here are two little bugs we regularly face with getARGV and which should be easy to fix.

1/ default values for real variables.
real toto = getARGV(’-toto’,1) -> creates a bug
real toto = getARGV(’-toto’, 1.) -> works correctly.

2/ multiple inclusions of getARGV.
I have seen that some idp files contain the line 'include “getARGV.idp” ', for instance macros_ddm.idp.
This can cause a bug very difficult to track if one’s code also contains this line. Especially because the bug is not present on all systems (one of my students has this behaviour with his ubuntu18 laptop, i don’t have it on my mac)

Suggested solution : add at the top of getARGV.idp something like
IFMACRO(!USEGETARGV)
macro USEGETARGV 1 //
(… content of getARGV.idp …)
ENDIFMACRO

Thanks !
David

About 1/, what bug? Be careful, getARGV("-toto",1) will always return an integer, because 1 is an integer, while 1. is a scalar. 2/ It’s already there, cf. getARGV.idp.

Thanks for reply

1/ Not really a bug, you are right, but a recurrent error not easy to track. The error message is not very helpful and one can easily lose al long time to understand the problem.

current line = 72
call getARGV at line 3
Assertion fail : (isspace(*ppe))
line :899, in file AFunction.cpp
Assertion fail : (isspace(*ppe))
line :899, in file AFunction.cpp
err code 6 , mpirank 0

2/ great ! so this simply means my student has to upgrade his freefem version.

1/ OK, I don’t think there is much we can do about this, if you expect -toto to be a real scalar, just don’t use an integer in your .edp
2/ Yes, 4.7-1 is available on almost all architectures (with PETSc/SLEPc support on all those architectures BTW), so it shouldn’t be too troublesome (at least it wasn’t for my students this year)