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

tests fail #323

Open
mouse07410 opened this issue Feb 19, 2025 · 2 comments
Open

tests fail #323

mouse07410 opened this issue Feb 19, 2025 · 2 comments
Assignees

Comments

@mouse07410
Copy link

Either the warnings are too pedantic/restrictive, or the sources are bad:

$ cd v4Tests
$ make
. . .
All test cases (8) run successfully.
File 'sample1.c'
Lines executed:100.00% of 40
Creating 'sample1.c.gcov'

01-INTEGER/006.asn1 MyPDU[encoding ASCII, size -200]
c ACN /Users/ur20980/src/asn1scc/v4Tests/test-cases/acn/01-INTEGER/007.asn1
01-INTEGER/007.asn1 MyPDU[encoding ASCII, size null-terminated]
/Applications/Xcode.app/Contents/Developer/usr/bin/make && ./mainprogram && \
	    gcov sample1.c
gcc -c -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG     -I . -O0 -fprofile-arcs -ftest-coverage -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG     -I . -O0 -fprofile-arcs -ftest-coverage -o asn1crt.o asn1crt.c
gcc -c -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG     -I . -O0 -fprofile-arcs -ftest-coverage -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG     -I . -O0 -fprofile-arcs -ftest-coverage -o asn1crt_encoding.o asn1crt_encoding.c
gcc -c -O3 -std=gnu18 -march=native -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG     -I . -O0 -fprofile-arcs -ftest-coverage -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG     -I . -O0 -fprofile-arcs -ftest-coverage -o asn1crt_encoding_acn.o asn1crt_encoding_acn.c
asn1crt_encoding_acn.c:219:14: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
  219 |         asn1SccSint i = 0;
      |                     ^
1 error generated.
make[2]: *** [asn1crt_encoding_acn.o] Error 1
make[1]: *** [coverage] Error 2
cd /Users/ur20980/src/asn1scc/v4Tests/tmp_c/; CC=gcc make coverage
make: *** [cTests] Error 1
@maxime-esa
Copy link
Collaborator

@usr3-1415 can you check this please?

usr3-1415 added a commit that referenced this issue Feb 23, 2025
Remove unused variable and update version number

- Removed the variable `i` from `Acn_Dec_UInt_ASCII_VarSize_NullTerminated`, which was used for iteration counting, potentially affecting loop behavior.
- Updated the version string in `printVersion` from "4.5.2.5" to "4.5.2.6" to reflect the latest version increment. Retained commented-out lines for assembly version retrieval.
@usr3-1415
Copy link
Collaborator

Thanks for reporting this issue.
I locally ran the test case 01-INTEGER/007.asn1, which passed successfully. However, upon examining the generated source code, I identified a redundant local variable, which was declared and later incremented in a loop but had no effect on execution. I've removed this variable in a recent commit, which should resolve any related warnings or errors.

It's worth noting that you're likely using a more recent version of GCC that detects such issues, whereas the asn1scc Dockerfile specifies an older GCC version. This discrepancy explains why our GitHub Actions build-and-test pipeline hasn't encountered these errors, as it utilizes the environment defined in the Dockerfile.

As a result, similar issues may arise due to differences in compiler versions. We do plan to update the Dockerfile to use a more recent GCC version, but this may take some time as it requires verifying and addressing any new warnings or errors introduced by the update.

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