Skip to content
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

Build warning - source/pprint.c #44

Open
bondhugula opened this issue Jun 11, 2019 · 2 comments
Open

Build warning - source/pprint.c #44

bondhugula opened this issue Jun 11, 2019 · 2 comments

Comments

@bondhugula
Copy link
Collaborator

I notice one build warning with
gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)

CC source/libcloog_isl_la-statement.lo
In function ‘pprint_replacestr’,
inlined from ‘pprint_replacestr’ at source/pprint.c:436:7:
source/pprint.c:457:5: warning: ‘strncat’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
457 | strncat(result, replace, strlen(replace));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The line numbers may not match with the master branch (as I have a forked version), but here's the code snippet for context:

while ((pos1 = strstr(pos, sub))) {
  int len = (pos1 - pos);
  strncat(result, pos, len);
  strncat(result, replace, strlen(replace));
  pos = (pos1 + strlen(sub));
}
@harenome
Copy link
Collaborator

Hi, are you sure this snippet is not specific to your local version? I can not find any use of strstr() or strncat() in master.

@Syllo
Copy link
Collaborator

Syllo commented Jun 12, 2019

Hi,
The function pprint_replacestr is not present, anywhere in CLooG source files, at least in the master branch 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants