# Two small issues with getARGV

**URL:** <https://community.freefem.org/t/two-small-issues-with-getargv/658>\
**Category:** Feature Request\
**Created:** [November 17, 2020, 2:23pm UTC](https://community.freefem.org/t/two-small-issues-with-getargv/658 "2020-11-17T14:23:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.fabre](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@david.fabre](https://community.freefem.org/u/david.fabre)\
**Post date:** [November 17, 2020, 2:23pm UTC](https://community.freefem.org/t/two-small-issues-with-getargv/658/1 "2020-11-17T14:23:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 17, 2020, 3:02pm UTC](https://community.freefem.org/t/two-small-issues-with-getargv/658/2 "2020-11-17T15:02:10Z")

</div>

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](https://github.com/FreeFem/FreeFem-sources/blob/master/idp/getARGV.idp#L7-L8).

---

<div class="post-metadata">

**Author:** ![david.fabre](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@david.fabre](https://community.freefem.org/u/david.fabre)\
**Post date:** [November 18, 2020, 8:37am UTC](https://community.freefem.org/t/two-small-issues-with-getargv/658/3 "2020-11-18T08:37:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [November 18, 2020, 8:49am UTC](https://community.freefem.org/t/two-small-issues-with-getargv/658/4 "2020-11-18T08:49:07Z")

</div>

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](https://github.com/FreeFem/FreeFem-sources/releases/tag/v4.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)
