chore: fix compilation warnings#148
Merged
dilawar merged 7 commits intossandrews:masterfrom Nov 18, 2025
Merged
Conversation
dilawar
commented
Nov 18, 2025
dilawar
commented
Nov 18, 2025
| simptr sim; | ||
| int i,er,pflag,wflag,tflag,Vflag,oflag; | ||
| char root[STRCHARLONG],fname[STRCHARLONG],flags[STRCHARLONG],*cptr,logfile[STRCHARLONG]; | ||
| char root[STRCHARLONG],fname[STRCHARLONG],flags[STRCHARLONG+100],*cptr,logfile[STRCHARLONG]; |
Collaborator
Author
There was a problem hiding this comment.
Allocate a bit more to avoid potential overflow.
dilawar
commented
Nov 18, 2025
| #define CHECKM(A,...) if(!(A) || strmatherror(ErrorMath,1)) {ErrorType=2;snprintf(strcat(ErrorString,ErrorMath),STRCHARLONG,__VA_ARGS__); goto failure;} else (void)0 | ||
| #define CHECKBUG(A,...) if(!(A)) {ErrorType=4;snprintf(ErrorString,STRCHARLONG,__VA_ARGS__); goto failure;} else (void)0 | ||
| // snprintf may truncate output. We abort in case of output truncation. | ||
| #define CHECKS(A,...) if(!(A)) {ErrorType=2;snprintf(ErrorString,STRCHARLONG,__VA_ARGS__) < 0 ? abort() : (void)0; goto failure;} else (void)0 |
Collaborator
Author
There was a problem hiding this comment.
snprintf can potentially truncate, hence the check. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85783 has some relevant discussion.
dilawar
commented
Nov 18, 2025
| filtype->shiny=0; | ||
| filtype->drawforcescale=0; | ||
| filtype->drawforcecolor[0]=filtype->drawforcecolor[0]=filtype->drawforcecolor[0]=0; | ||
| filtype->drawforcecolor[0]=filtype->drawforcecolor[1]=filtype->drawforcecolor[2]=0; |
Collaborator
Author
There was a problem hiding this comment.
I guess this was a mistake in original code.
On Windows, c++17 causing conflict with std::byte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes various compilation warnings.
TODO: