4
7
Fork
You've already forked dev86
5

C99 compatibility issue #2

Closed
opened 2024年03月27日 16:38:04 +01:00 by NHOrus · 3 comments
Contributor
Copy link

Builds with modern compilers (Clang 17 and GCC 13 with C99 errors enabled) fail with following errors:

cpp.c:548:9: error: parameter 'ch' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int]
 548 | unchget(ch)
 | ^
 549 | {
tok_io.c:219:13: error: call to undeclared function 'atoi'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 219 | line = atoi(t->vstr->str); /* extract line number */
 | ^
In file included from token1.c:11:
tok_io.c:488:13: error: call to undeclared library function 'strlen' with type 'unsigned long (const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 488 | if ((len = strlen(buf)) > 3)
 | ^
tok_io.c:488:13: note: include the header <string> or explicitly provide a declaration for 'strlen'
Builds with modern compilers (Clang 17 and GCC 13 with C99 errors enabled) fail with following errors: ``` cpp.c:548:9: error: parameter 'ch' was not declared, defaults to 'int'; ISO C99 and later do not support implicit int [-Wimplicit-int] 548 | unchget(ch) | ^ 549 | { ``` ``` tok_io.c:219:13: error: call to undeclared function 'atoi'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 219 | line = atoi(t->vstr->str); /* extract line number */ | ^ In file included from token1.c:11: ``` ``` tok_io.c:488:13: error: call to undeclared library function 'strlen' with type 'unsigned long (const char *)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 488 | if ((len = strlen(buf)) > 3) | ^ tok_io.c:488:13: note: include the header <string> or explicitly provide a declaration for 'strlen' ```

Please test the changes I just made and make sure it works now. Also, when submitting errors, it helps to have a little more context like the Make directory enter/leave parts. I had to hunt for tok_io.c to fix it.

Please test the changes I just made and make sure it works now. Also, when submitting errors, it helps to have a little more context like the Make directory enter/leave parts. I had to hunt for tok_io.c to fix it.
Author
Contributor
Copy link

Sorry about bad error reporting. Was planning to do a PR myself.
Existing errors are fixed, but there are new ones. will submit fix shortly.

Sorry about bad error reporting. Was planning to do a PR myself. Existing errors are fixed, but there are new ones. will submit fix shortly.
Author
Contributor
Copy link

#3 is Pull Requests with all the fixes.
Thank you!

#3 is Pull Requests with all the fixes. Thank you!
Sign in to join this conversation.
No Branch/Tag specified
master
lr-checks
msdos
release
v1.0.1
v1.0
v0.16.21
v0.16.20
v0.16.19
v0.16.18
v0.16.17
v0.16.16
v0.16.15
v0.16.14
v0.16.13
v0.16.12
v0.16.9
v0.16.8
v0.16.11
v0.16.10
v0.16.7
v0.16.6
v0.16.5
v0.16.4
v0.16.3
v0.16.2
v0.16.1
v0.16.0
v0.15.6
v0.15.5
v0.15.4
v0.15.3
v0.15.1
v0.15.0
v0.14.8
v0.14.7
v0.14.5
v0.14.3
v0.14.0
v0.13.5
v0.13.0
v0.12.4
v0.12.0
v0.0.11
v0.0.9
v0.0.8
v0.0.7
v0.0.6
v0.0.5
v0.0.4
origs
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jbruchon/dev86#2
Reference in a new issue
jbruchon/dev86
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?