aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.sh8
-rw-r--r--test/020_io_H48_read_write/io_H48_tests.c8
-rw-r--r--test/021_io_SRC_write/io_SRC_tests.c8
-rw-r--r--test/023_io_LST_write/io_LST_tests.c8
4 files changed, 19 insertions, 13 deletions
diff --git a/configure.sh b/configure.sh
index e4a142d..fdebf27 100755
--- a/configure.sh
+++ b/configure.sh
@@ -7,12 +7,9 @@ detectsan() { cc -fsanitize=$1 -dM -E -x c - </dev/null | grep "SANITIZE"; }
7 7
8TYPE=${TYPE-"$detected"} 8TYPE=${TYPE-"$detected"}
9 9
10echo "Using CUBE_$TYPE"
11
12STD="-std=c99" 10STD="-std=c99"
13WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function" 11WFLAGS="-pedantic -Wall -Wextra -Wno-unused-parameter -Wno-unused-function"
14[ "$TYPE" = "AVX2" ] && AVX="-mavx2" 12[ "$TYPE" = "AVX2" ] && AVX="-mavx2"
15
16[ -n "$(detectsan address)" ] && ADDR="-fsanitize=address" 13[ -n "$(detectsan address)" ] && ADDR="-fsanitize=address"
17[ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined" 14[ -n "$(detectsan undefined)" ] && UNDEF="-fsanitize=undefined"
18SAN="$ADDR $UNDEF" 15SAN="$ADDR $UNDEF"
@@ -20,11 +17,14 @@ SAN="$ADDR $UNDEF"
20CFLAGS="$STD $WFLAGS $AVX -O3" 17CFLAGS="$STD $WFLAGS $AVX -O3"
21DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG" 18DBGFLAGS="$STD $WFLAGS $AVX -g3 -DDEBUG"
22 19
20echo "Cube type: CUBE_$TYPE"
21echo "Compiler: ${CC:-cc}"
22
23{ 23{
24echo "CUBETYPE = CUBE_$TYPE"; 24echo "CUBETYPE = CUBE_$TYPE";
25echo ""; 25echo "";
26echo "CFLAGS = $CFLAGS"; 26echo "CFLAGS = $CFLAGS";
27echo "DBGFLAGS = $DBGFLAGS"; 27echo "DBGFLAGS = $DBGFLAGS";
28echo ""; 28echo "";
29echo "CC = cc" 29echo "CC = ${CC:-cc}"
30} > config.mk 30} > config.mk
diff --git a/test/020_io_H48_read_write/io_H48_tests.c b/test/020_io_H48_read_write/io_H48_tests.c
index fafd396..705356c 100644
--- a/test/020_io_H48_read_write/io_H48_tests.c
+++ b/test/020_io_H48_read_write/io_H48_tests.c
@@ -1,11 +1,13 @@
1#include "../test.h" 1#include "../test.h"
2 2
3int main(void) { 3int main(void) {
4 char *c, str[STRLENMAX]; 4 char str[STRLENMAX], *aux;
5 cube_t cube; 5 cube_t cube;
6 6
7 for (c = str; (*c = getchar()) != EOF; c++) ; 7 aux = str;
8 *c = '\0'; 8 while (fgets(aux, STRLENMAX, stdin) != NULL)
9 while (*aux != '\n')
10 aux++;
9 11
10 cube = readcube("H48", str); 12 cube = readcube("H48", str);
11 13
diff --git a/test/021_io_SRC_write/io_SRC_tests.c b/test/021_io_SRC_write/io_SRC_tests.c
index ca33d1e..c427c6c 100644
--- a/test/021_io_SRC_write/io_SRC_tests.c
+++ b/test/021_io_SRC_write/io_SRC_tests.c
@@ -1,11 +1,13 @@
1#include "../test.h" 1#include "../test.h"
2 2
3int main(void) { 3int main(void) {
4 char *c, str[STRLENMAX]; 4 char str[STRLENMAX], *aux;
5 cube_t cube; 5 cube_t cube;
6 6
7 for (c = str; (*c = getchar()) != EOF; c++) ; 7 aux = str;
8 *c = '\0'; 8 while (fgets(aux, STRLENMAX, stdin) != NULL)
9 while (*aux != '\n')
10 aux++;
9 11
10 cube = readcube("H48", str); 12 cube = readcube("H48", str);
11 13
diff --git a/test/023_io_LST_write/io_LST_tests.c b/test/023_io_LST_write/io_LST_tests.c
index 3f42d7a..45cc203 100644
--- a/test/023_io_LST_write/io_LST_tests.c
+++ b/test/023_io_LST_write/io_LST_tests.c
@@ -8,11 +8,13 @@ cube_t readcube(char *, char *);
8void writecube(char *, cube_t, char *); 8void writecube(char *, cube_t, char *);
9 9
10int main(void) { 10int main(void) {
11 char *c, str[STRLENMAX]; 11 char str[STRLENMAX], *aux;
12 cube_t cube; 12 cube_t cube;
13 13
14 for (c = str; (*c = getchar()) != EOF; c++) ; 14 aux = str;
15 *c = '\0'; 15 while (fgets(aux, STRLENMAX, stdin) != NULL)
16 while (*aux != '\n')
17 aux++;
16 18
17 cube = readcube("H48", str); 19 cube = readcube("H48", str);
18 20

Generated with cgit - Back to sebastiano.tronto.net