liblouis / liblouis

Open-source braille translator and back-translator.
http://liblouis.io
GNU Lesser General Public License v2.1
265 stars 209 forks source link

NVDA buildsystem fails to build current master #1685

Open LeonarddeR opened 2 hours ago

LeonarddeR commented 2 hours ago

@bertfrees / @egli this might be a last minute showstopper for the release. When trying to build liblouis using clang in msvc, I"m getting the following error:

include\liblouis\liblouis\metadata.c(242,9): error: call to undeclared library function 'strncasecmp' with type 'int
      (const char *, const char *, unsigned int)'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
  242 |         return strncasecmp("language", key, len) == 0 ||
      |                ^
include\liblouis\liblouis\metadata.c(242,9): note: include the header <strings.h> or explicitly provide a declaration
      for 'strncasecmp'
LeonarddeR commented 2 hours ago

Here is a run of the bundled nmake script that also fails:

nmake /f Makefile.nmake

Microsoft (R) Program Maintenance Utility Version 14.42.34435.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        PowerShell -ExecutionPolicy RemoteSigned  -File utils\find-replace.ps1  -InputFile ..\liblouis\liblouis.h.in -OutputFile ..\liblouis\liblouis.h  -Str1 @WIDECHAR_TYPE@ -Str2 "unsigned short int"
        clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\commonTranslationFunctions.c
        clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\compileTranslationTable.c
..\liblouis\compileTranslationTable.c(2894,16): warning: unused variable 'macro' [-Wunused-variable]
 2894 |                 const Macro *macro;
      |                              ^~~~~
..\liblouis\compileTranslationTable.c(2742,1): warning: unused function 'cons_macro' [-Wunused-function]
 2742 | cons_macro(const Macro *head, const MacroList *tail) {
      | ^~~~~~~~~~
..\liblouis\compileTranslationTable.c(2778,1): warning: unused function 'compileMacro' [-Wunused-function]
 2778 | compileMacro(FileInfo *file, const Macro **macro) {
      | ^~~~~~~~~~~~
3 warnings generated.
        clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\logging.c
..\liblouis\logging.c(104,10): warning: unused variable 'f' [-Wunused-variable]
  104 |                 double f = 2.3;  // Needed to force VC++ runtime floating point support
      |                        ^
1 warning generated.
        clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\lou_backTranslateString.c
        clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\lou_translateString.c
..\liblouis\lou_translateString.c(2916,19): warning: variable 'last_word_start' set but not used
      [-Wunused-but-set-variable]
 2916 |         int in_word = 0, last_word_start = -1, last_word_end = -1;
      |                          ^
1 warning generated.
        clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\metadata.c
..\liblouis\metadata.c(242,9): error: call to undeclared library function 'strncasecmp' with type 'int (const char *,
      const char *, unsigned long long)'; ISO C99 and later do not support implicit function declarations
      [-Wimplicit-function-declaration]
  242 |         return strncasecmp("language", key, len) == 0 ||
      |                ^
..\liblouis\metadata.c(242,9): note: include the header <strings.h> or explicitly provide a declaration for
      'strncasecmp'
..\liblouis\metadata.c(609,41): warning: format specifies type 'long' but the argument has type 'unsigned long long'
      [-Wformat]
  609 |                 if (!*value) sprintf(value, "ucs%ld", CHARSIZE);
      |                                                 ~~~   ^~~~~~~~
      |                                                 %llu
..\liblouis\internal.h(65,18): note: expanded from macro 'CHARSIZE'
   65 | #define CHARSIZE sizeof(widechar)
      |                  ^~~~~~~~~~~~~~~~
1 warning and 1 error generated.
NMAKE : fatal error U1077: 'clang-cl /nologo /O2 /W3 /c /MD /Iinclude /D_EXPORTING /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE ..\liblouis\metadata.c' : return code '0x1'
Stop.
bertfrees commented 2 hours ago

@LeonarddeR We could address this in a bugfix release.

LeonarddeR commented 2 hours ago

I might be able to have a pr ready in around 10 minutes.