lpython icon indicating copy to clipboard operation
lpython copied to clipboard

lots of warnings & broken tests in C back-end for Ubuntu 22.04.3 LTS

Open khushi-411 opened this issue 2 years ago • 0 comments

As per the title, we get the following warnings and errors:

/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/array_01.c: In function ‘main0’:
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/array_01.c:442:31: warning: format ‘%li’ expects argument of type ‘long int’, but argument 6 has type ‘int32_t’ {aka ‘int’} [-Wformat=]
  442 |             printf("%d%s%d%s%li\n", i, " ", j, " ", arr->data[((0 + (1 * (j - 0))) + ((1 * 600) * (i - 0)))]);
      |                             ~~^                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                               |                              |
      |                               long int                       int32_t {aka int}
      |                             %i
[  6%] Generating bindc_04.c
[  6%] Building C object CMakeFiles/bindc_01.dir/bindc_01.c.o
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/array_02.c: In function ‘main0’:
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/array_02.c:457:39: warning: format ‘%li’ expects argument of type ‘long int’, but argument 8 has type ‘int32_t’ {aka ‘int’} [-Wformat=]
  457 |                 printf("%d%s%d%s%d%s%li\n", i, " ", j, " ", k, " ", arr->data[(((0 + (1 * (k - 0))) + ((1 * 20) * (j - 0))) + (((1 * 20) * 60) * (i - 0)))]);
      |                                     ~~^                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                       |                                      |
      |                                       long int                               int32_t {aka int}
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_06.c: In function ‘main0’:
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_06.c:103:12: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  103 |     printf("");
      |            ^~
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_06.c:112:12: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  112 |     printf("");
      |            ^~
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_02.c: In function ‘f’:
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_02.c:366:12: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  366 |     printf("");
      |            ^~
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_02.c:369:12: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  369 |     printf("");
      |            ^~
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/print_02.c:372:12: warning: zero-length gnu_printf format string [-Wformat-zero-length]
  372 |     printf("");
      |            ^~
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_str_04.c: In function ‘main0’:
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_str_04.c:19:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
   19 |     printf("%d\n", strlen(x));
      |             ~^     ~~~~~~~~~
      |              |     |
      |              int   size_t {aka long unsigned int}
      |             %ld
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_str_04.c:22:14: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=]
   22 |     printf("%d\n", strlen(y));
      |             ~^     ~~~~~~~~~
      |              |     |
      |              int   size_t {aka long unsigned int}
      |             %ld
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c:17:14: error: stray ‘\316’ in program
   17 | const double �� =   1.45136923488338110e+00;
      |              ^
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c:17:15: error: stray ‘\274’ in program
   17 | const double �� =   1.45136923488338110e+00;
      |               ^
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c:17:17: error: expected identifier or ‘(’ before ‘=’ token
   17 | const double μ =   1.45136923488338110e+00;
      |                 ^
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c: In function ‘f’:
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c:36:21: error: stray ‘\316’ in program
   36 |     printf("%lf\n", ��);
      |                     ^
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c:36:22: error: stray ‘\274’ in program
   36 |     printf("%lf\n", ��);
      |                      ^
/home/khushi/Documents/lpython/integration_tests/_lpython-tmp-test-c/test_import_02.c:36:23: error: expected expression before ‘)’ token
   36 |     printf("%lf\n", μ);
      |                       ^

Eventually, it breaks after this...

[ 45%] Building C object CMakeFiles/test_numpy_01.dir/test_numpy_01.c.o
[ 45%] Linking C executable test_numpy_01
[ 45%] Built target test_numpy_01
gmake: *** [Makefile:101: all] Error 2
Command failed: cmake --build . --parallel 8

khushi-411 avatar Dec 19 '23 15:12 khushi-411