No warnings with a C or C++ compiler#85
Open
c-kloukinas wants to merge 3 commits intonimble-code:masterfrom
Open
No warnings with a C or C++ compiler#85c-kloukinas wants to merge 3 commits intonimble-code:masterfrom
c-kloukinas wants to merge 3 commits intonimble-code:masterfrom
Conversation
…ted a header file for it.
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.
Aim: Code improvements (no compilation warnings)/Porting to C++.
To compile with a C++ compiler, one now has to set both CC & CXX to be that compiler, like
env CC=g++ CXX=${CC} makeFor another project I'm planing I need to use a C++ compiler to compile Spin.
So as a first step I tried to
For (1.), I mainly had to rename
SeqList's fieldSequence *thistoSequence *thisSand changestatic FSM_trans *explicittostatic FSM_trans *explicit_ptr, sincethisandexplicitare reserved words in C++.But there were also issues with some C warnings, that C++ treats as errors.
Therefore I also attempted (2.), to eliminate all compilation warnings under both C and C++. This mainly entailed adding
constto function parameters. In some cases I also replaced plain static char arrays withstrdupof them.When considering the changes, please set it so that whitespace changes are ignored (there are quite few of these unfortunately, as my editor is set to replace tabs and delete end-of-line whitespace before saving - really sorry for this).
I hope that this PR will help improve the code's robustness and make it easier to spot errors in future updates.