New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libgis: Add string concatenation function #1401
Conversation
centos7 isn't too happy with this:
?? |
Should we support compiler-specific extensions like Reading https://trac.osgeo.org/grass/wiki/RFC/7_LanguageStandardsSupport, have we already reached a consensus about the final language standards? |
I was trying to please Centos7 CI with |
I agree. |
By default gcc 4.8.5 uses For the record: configuring CentOS7 with -std=gnu99, enables the use of |
6620eb1
to
81374ee
Compare
As I mentioned before, the name |
@HuidaeCho Thanks ! Applied you suggestions, ready for a new round :) . |
@nilason Looks good to me. Just out of curiosity, any reason for double underscores in @neteler Do we have a rule for |
It's just to differentiate against open API. |
Oh! That's a static function. |
@nilason I just have one last suggestion. Please move |
81374ee
to
7dce1e4
Compare
Reordered per suggestion. |
A separate PR per https://trac.osgeo.org/grass/wiki/Submitting/C#Indentation would be great or maybe together in this PR may be better. |
7dce1e4
to
17af484
Compare
I applied the grass_indent.sh, but kept its result only on touched parts (not whole file). That should be for another time/PR. If I only knew before, there is no need for those 8-sized tabs... |
Thanks a lot @HuidaeCho ! |
Working on solutions for compiler warnings (#1247), specifically attempting to address a -Wformat-overflow I missed the existence of a string concatenation function.
This PR is a suggestion for a concatenation function added to libgis:
It is based on a local version of the memccpy implementation taken from www.open-std.org : N2349.
The PR consists of two commits, one with the addition of the G_str_concat() function, the other is a fix for the mentioned warning (and serves as usage example).
This function could possibly find its use elsewhere, e.g.
r.li.cwed
has its own concatenation solution, which may justify the addition.