audk/BaseTools/Source/C
Laszlo Ersek 1d212a83df BaseTools/header.makefile: add "-Wno-stringop-truncation"
gcc-8 (which is part of Fedora 28) enables the new warning
"-Wstringop-truncation" in "-Wall". This warning is documented in detail
at <https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html>; the
introduction says

> Warn for calls to bounded string manipulation functions such as strncat,
> strncpy, and stpncpy that may either truncate the copied string or leave
> the destination unchanged.

It breaks the BaseTools build with:

> EfiUtilityMsgs.c: In function 'PrintMessage':
> EfiUtilityMsgs.c:484:9: error: 'strncat' output may be truncated copying
> between 0 and 511 bytes from a string of length 511
> [-Werror=stringop-truncation]
>          strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> EfiUtilityMsgs.c:469:9: error: 'strncat' output may be truncated copying
> between 0 and 511 bytes from a string of length 511
> [-Werror=stringop-truncation]
>          strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
>          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> EfiUtilityMsgs.c:511:5: error: 'strncat' output may be truncated copying
> between 0 and 511 bytes from a string of length 511
> [-Werror=stringop-truncation]
>      strncat (Line, Line2, MAX_LINE_LEN - strlen (Line) - 1);
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The right way to fix the warning would be to implement string concat with
snprintf(). However, Microsoft does not appear to support snprintf()
before VS2015
<https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010>,
so we just have to shut up the warning. The strncat() calls flagged above
are valid BTW.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Cole Robinson <crobinso@redhat.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
2018-03-05 22:38:09 +01:00
..
BootSectImage BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
BrotliCompress BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
Common BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
DevicePath BaseTools: Fix byte orders when handling 8-byte array 2018-03-03 15:41:16 +08:00
EfiLdrImage BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
EfiRom BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GenBootSector BaseTools/GenBootSector: Add/refine boundary checks for strcpy/strcat 2017-12-25 09:54:25 +08:00
GenCrc32 BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GenFfs BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GenFv BaseTools: Resolve BaseTools C tool build failure 2018-02-27 18:34:03 +08:00
GenFw BaseTools: Update GenFw to correct DebugEntry Offset when convert XIP image 2018-02-27 18:43:30 +08:00
GenPage BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GenSec BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GenVtf BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GnuGenBootSector BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
Include BaseTools: update DNS_DEVICE_PATH/URI_DEVICE_PATH definition 2018-03-05 15:22:59 +08:00
LzmaCompress BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
Makefiles BaseTools/header.makefile: add "-Wno-stringop-truncation" 2018-03-05 22:38:09 +01:00
PyEfiCompressor License header updated to match correct format. 2014-08-28 13:53:34 +00:00
PyUtility License header updated to match correct format. 2014-08-28 13:53:34 +00:00
Split BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
TianoCompress BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
VfrCompile BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
VolInfo BaseTools GNUmakefile: Remove HOST_ARCH in every tool Makefile 2018-02-06 13:44:42 +08:00
GNUmakefile BaseTools: Add DevicePath support for PCD values 2017-12-31 13:10:49 +08:00
Makefile BaseTools: Add DevicePath support for PCD values 2017-12-31 13:10:49 +08:00