Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

silence pointer arithmetic warning issued for !GDL.RELEASE string trim #1872

Closed
GillesDuvert opened this issue Aug 13, 2024 · 1 comment · Fixed by #1875
Closed

silence pointer arithmetic warning issued for !GDL.RELEASE string trim #1872

GillesDuvert opened this issue Aug 13, 2024 · 1 comment · Fixed by #1875

Comments

@GillesDuvert
Copy link
Contributor

Compilation produces

initsysvar.cpp:659:58: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
gdlStruct->NewTag("RELEASE", new DStringGDL( VERSION + (VERSION[0] == 'v' ? 1 : 0)));

I do not see the point of doing this, so I leave it as it is....

@slayoo
Copy link
Member

slayoo commented Aug 14, 2024

Thanks @GillesDuvert for reporting.
I've introduced it here: #1780
The idea is to strip the leading "v" in the C string (char*) VERSION by adding one to the pointer.
git describe returns the tag name which in most cases starts with "v" (like v1.0.0), but we expect !GDL.RELEASE to be 1.0.1

@slayoo slayoo changed the title Please check version-string related bug silence pointer arithmetic warning issued for !GDL.RELEASE string trim Aug 16, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants