ahknight / crc32c Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Hi adan,
I made a little change on the test suite (main.c) to load a file content and generate the crc32c for that code.
but the program crash (segmentation fault) inside the function crc32cHardware32, just looping in the first for when the file have more than some bytes. (I test it with a 400kb file).
can you tell me why or if you have any approach to find the problem?
Hello,
I've no idea if i should use some special parameters here - just typed "make" in the cloned folder..
Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-43-generic x86_64)
g++ -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o test/crc32c_test.o test/crc32c_test.cc
test/crc32c_test.cc: In member function ‘virtual void CRC32C_CPUDetection::run()’:
test/crc32c_test.cc:15:14: warning: variable ‘crc’ set but not used [-Wunused-but-set-variable]
uint32_t crc = crc32c(crc32cInit(), NULL, 0);
^
g++ -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o test/stupidunit.o test/stupidunit.cc
g++ -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o logging/crc32c_tables.o logging/crc32c_tables
.cc
g++ -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o logging/crc32c.o logging/crc32c.cc
c++ -o crc32c_test test/crc32c_test.o test/stupidunit.o logging/crc32c_tables.o logging/crc32c.o
g++ -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o bench/crc32c_bench.o bench/crc32c_bench.cc
c++ -o crc32c_bench bench/crc32c_bench.o logging/crc32c_tables.o logging/crc32c.o
cc -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o main.o main.c
main.c: In function ‘main’:
main.c:21:15: warning: unused parameter ‘argc’ [-Wunused-parameter]
int main (int argc, const char * argv[])
^
main.c:21:34: warning: unused parameter ‘argv’ [-Wunused-parameter]
int main (int argc, const char * argv[])
^
cc -O3 -DNDEBUG -msse4.2 -I. -Wall -Wextra -Wno-sign-compare -c -o crc32c/crc32c.o crc32c/crc32c.c
crc32c/crc32c.c: In function ‘crc32cSlicingBy4’:
crc32c/crc32c.c:84:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t li = 0; li < initial_bytes; li++) {
^
crc32c/crc32c.c:84:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
crc32c/crc32c.c:92:17: error: redefinition of ‘li’
for (size_t li = 0; li < running_length/4; li++) {
^
crc32c/crc32c.c:84:17: note: previous definition of ‘li’ was here
for (size_t li = 0; li < initial_bytes; li++) {
^
crc32c/crc32c.c:92:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t li = 0; li < running_length/4; li++) {
^
crc32c/crc32c.c:103:17: error: redefinition of ‘li’
for (size_t li=0; li < end_bytes; li++) {
^
crc32c/crc32c.c:92:17: note: previous definition of ‘li’ was here
for (size_t li = 0; li < running_length/4; li++) {
^
crc32c/crc32c.c:103:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t li=0; li < end_bytes; li++) {
^
crc32c/crc32c.c: In function ‘crc32cSlicingBy8’:
crc32c/crc32c.c:116:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t li = 0; li < initial_bytes; li++) {
^
crc32c/crc32c.c:124:17: error: redefinition of ‘li’
for (size_t li = 0; li < running_length/8; li++) {
^
crc32c/crc32c.c:116:17: note: previous definition of ‘li’ was here
for (size_t li = 0; li < initial_bytes; li++) {
^
crc32c/crc32c.c:124:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t li = 0; li < running_length/8; li++) {
^
crc32c/crc32c.c:143:17: error: redefinition of ‘li’
for (size_t li=0; li < end_bytes; li++) {
^
crc32c/crc32c.c:124:17: note: previous definition of ‘li’ was here
for (size_t li = 0; li < running_length/8; li++) {
^
crc32c/crc32c.c:143:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t li=0; li < end_bytes; li++) {
^
crc32c/crc32c.c: In function ‘crc32cHardware32’:
crc32c/crc32c.c:154:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t i = 0; i < length / sizeof(uint32_t); i++) {
^
crc32c/crc32c.c: In function ‘crc32cHardware64’:
crc32c/crc32c.c:194:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
for (size_t i = 0; i < length / sizeof(uint64_t); i++) {
^
make: *** [crc32c/crc32c.o] Fehler 1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.