Am 03.03.2021 14:06 schrieb Sven Schreiber:
Am 03.03.2021 um 13:31 schrieb atecon:

with latest git version under Ubuntu 18.04 I obtain a crash when
running the following script:
Confirmed with a recent snapshot on Windows. That one looks pretty bad,
but...

Thanks for confirming this, Sven.


function void simple (const int N[2::])

...it doesn't crash anymore for me when removing "const". And only Artur
would put a const in front of an int ;-)

It also does not crash in case the lower bound is _not_ hit <function void simple (const int N[1::])> ;-)

That is true. Writing const is such an automatism for me ;-) Even though the pointer speed effect is negligible in this case, I still have the "security effect" that the supposed to be constant parameter cannot be overwritten ;-)

Actually, I believe it is not supported by hansl to do "const int": The
guide says "the const modifier may be used... for all the types that
support the pointer apparatus". And if you try the following function:

<hansl>

function void simplestar ( int *N)
 print "very simple"
end function
</hansl>

you get the error message "unknown data type 'int *'". You have to use
"scalar *N" instead. And indeed, the variant "const scalar N[2::])"
works and doesn't crash.

Yes, that sounds familiar to me.

But of course the above is a bad bug anyway, and "const int" should be
intercepted by gretl in the first place.

Or may be not so given the other side effect I mentioned: the "security effect" ;-)

Artur
_______________________________________________
Gretl-devel mailing list -- gretl-devel@gretlml.univpm.it
To unsubscribe send an email to gretl-devel-le...@gretlml.univpm.it
Website: 
https://gretlml.univpm.it/postorius/lists/gretl-devel.gretlml.univpm.it/

Reply via email to