Giter Site home page Giter Site logo

safestringlib's Introduction

safestringlib

The Secure Development Lifecycle (SDL) recommends banning certain C Library functions because they directly contribute to security vulnerabilities such as buffer overflows. However routines for the manipulation of strings and memory buffers are common in software and firmware, and are essential to accomplish certain programming tasks. Safer replacements for these functions that avoid or prevent serious security vulnerabilities (e.g. buffer overflows, string format attacks, conversion overflows/underflows, etc.) are available in the SafeString Library.

This library includes routines for safe string operations (like strcpy) and memory routines (like memcpy) that are recommended for Linux/Android operating systems, and will also work for Windows. This library is especially useful for cross-platform situations where one library for these routines is preferred.

The Safe String Library is based on the Safe C Library by Cisco, and includes replacement C Library functions for the SDL banned functions, as well as a number of additional useful routines that are also susceptible to buffer overflows. This library continues to be made available under the MIT Open Source License.

Cisco's Safe C Library was extended by Intel's Security Center of Excellence (SeCoE) to add additional routines, and include additional unit tests.

LIST OF PRIMARY FUNCTIONS:

  • memcmp_s()

  • memcpy_s()

  • memmove_s()

  • memset_s()

  • memzero_s()

  • stpcpy_s()

  • stpncpy_s()

  • strcat_s()

  • strcpy_s()

  • strcspn_s()

  • strncat_s()

  • strncpy_s()

  • strnlen_s()

  • strpbrk_s()

  • strspn_s()

  • strstr_s()

  • strtok_s()

  • wcpcpy_s()

  • wcscat_s()

  • wcscpy_s()

  • wcsncat_s()

  • wcsnlen_s()

  • wmemcmp_s()

  • wmemcpy_s()

  • wmemmove_s()

  • wmemset_s()

LIST OF ADDITIONAL STRING ROUTINES:

  • strcasecmp_s()
  • strcasestr_s()
  • strcmp_s()
  • strcmpfld_s()
  • strcpyfld_s()
  • strcpyfldin_s()
  • strcpyfldout_s()
  • strfirstchar_s()
  • strfirstdiff_s()
  • strfirstsmae_s()
  • strisalphanumeric_s()
  • strisascii_s()
  • strisdigit_s()
  • strishes_s()
  • strislowercase_s()
  • strismixedcase_s()
  • strispassword_s()
  • strisuppercase_s()
  • strlastchar_s()
  • strlastdiff_s()
  • strlastsame_s()
  • strljustify_s()
  • strnterminate_s()
  • strprefix_s()
  • stremovews_s()
  • strtolowercase_s()
  • strtouppercase_s()
  • strzero_s()

PLANNED ENHANCEMENTS:

  • Add full sprintf_s() support
  • Add full sscanf_s() support

Compile and create Debian package (Ubuntu)

On Ubuntu (probably also works on other Linux distributions), use the following commands to compile a library and create a Debian package for distribution.

cmake -S . -B build
cd build
make -j
cpack

The generated package can be installed and removed using the following commands:

sudo dpkg -i libsafestring_<version>_amd64.deb

sudo dpkg --purge libsafestring

When compiling other projects against the safestring library installed via the Debian package, in the source files:

#include <safe_lib.h>
#include <other relevant safestringlib headers>

In the CMakeLists.txt, add:

target_link_libraries(<target name> safestring_shared <other possible library dependencies>)

safestringlib's People

Contributors

ausyskin avatar cianx avatar friissoren avatar ifdu avatar malsbat avatar tomasbw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

safestringlib's Issues

Length guard in strisdigit_s not implemented

In function strisdigit_s, the dmax value is decremented in the per-character loop, but its value is never checked, so the loop carries on past the intended max length until it finds a null char, which is exactly the behaviour it exists to prevent.

Suggested fix: something like if (dmax<=0) break between lines 108 and 109 (if the output should be true).

Verify Test Case for wcsncat

Line 179 of wcsncat_s.c has a TODO about testing that at most slen characters are copied; need to verify that the test cases for wsncat actually verify this, and then remove the TODO

Pointer signedness mismatch in wmemset_s()

safestring/safeclib/wmemset_s.c: In function 'wmemset_s':
safestring/safeclib/wmemset_s.c:101:20: error: pointer targets in passing argument 1 of 'mem_prim_set32' differ in signedness [-Werror=pointer-sign]
mem_prim_set32(dest, len, value);
^~~~
In file included from safestring/safeclib/wmemset_s.c:34:
safestring/safeclib/mem_primitives_lib.h:71:1: note: expected 'uint32_t *' {aka 'unsigned int *'} but argument is of type 'wchar_t *' {aka 'int *'}
mem_prim_set32(uint32_t *dest, uint32_t dmax, uint32_t value);
^~~~~~~~~~~~~~
cc1: all warnings being treated as errors

$ cc --version
cc (Ubuntu 8.2.0-7ubuntu1) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Modular Build

Once support for more flexible builds is put in place (like autoconf) we should put in place the ability to select which functions are compiled in.

4K Size Limit for Destination Buffer due to RSIZE_MAX_STR

When a destination string of more than 4K is used (larger than RSIZE_MAX_STR), the constraint handler is revoked. I am confused as to why a 4K limit is set. This should be able to be set by the calling project (so put in a #ifndef). As otherwise this library is not usable where more than a 4k string is required.

fixup a strtok_s function's bug while testing on SPEC2006

Line 322 need to add one line " *ptr = dest; " to keep *ptr with the same value of *saveptr in glibc __strtok_r.

I found strtok_s() leads to an endless loop while running hmmio.c (Line 1411-1415) in hmmer of SPEC 2006. Using gdb to check it I found the *ptr remains the same value while glibc not.

The trick is that when we cannot find delimiter in src we have to point the *ptr to the end of dest,while in strtok_s *ptr points to the start.

hmmio.c source code:
while (sptr != NULL) { fprintf(fp, "%s%s\n", pfx, sptr); sptr = strtok(NULL, "\n"); }

__strtok_r in glibc : https://github.com/lattera/glibc/blob/master/string/strtok_r.c

memset_s function signature conflicts with C11 standard library memset_s

safestringlib:

errno_t
memset_s (void *dest, rsize_t len, uint8_t value);

c11 standard library:

errno_t
memset_s (void *dest, rsize_t destsz, int ch, rsize_t count);

It would be nicer if the signatures would not conflict.
My proposal would be to rename safestringlib's memset_s to memset8_s (in line with the other memsetXX_s variants) and perhaps also add the C11 function.

undefined behaviour in memcpy_s

Hi,

In memcpy_s there is a guard in place to prevent copying overlapping ranges (which is UB). However, the way the check is implemented it will trigger UB in all other cases. Comparing pointers from two separately allocated objects is forbidden as per 6.5.8 C11 except when using (in)equality. I suggest using a cast to uintptr_t as seen in mem_prim_move.

Best,
Fabian

/edit: Accidentally wrote memset_s at first.

documentation enhancement request

Would be great if the documentation would explain how this is more or less secure than normal linux software using -fstack-protector and FORTIFY_SOURCE, and please also document if and how this library enhances rather than replaces FORTIFY_SOURCE ?

new release

when will be new release/tag , as after last release 2017 and many patched merged after it.

Safestring library with non-Linux environment

Hi Dave,

I am developing some solution on ARM Trustzone with OPTEE, so, would like to have safestring compile by default. There are 2 issues I am facing.

o errno.h: There's no errno.h file in optee_os
o ctype.h: to have the build find declaration of toupper().

Following are the PRs. Thanks for your review.
#34
#35

Regards,
Divneil

ARM compiler needs ctype.h

some functions, like toupper(), are defined in ctype.h in the ARM compiler system, and should be added into the _USE_STDLIB #define section

RSIZE_MAX_MEM limit

The following code in include/safe_mem_lib.h sets the maximum limit of memcpy to 256 MB.
#define RSIZE_MAX_MEM ( 256UL << 20 ) /* 256MB */

If we have larger copies, is it safe to increase the value of RSIZE_MAX_MEM or should we do it in multiple chunks?

Please consider library versioning with releases or stable branches

Hi,

I'm a member of a project, which uses your library. Our build scripts used to download the source code
from github
for compilation.
This is problematic for two reasons. We want to verify the archive file's integrity using a checksum. However, the zip file changes with every commit, so the checksum changes too, so the checks fail.
Secondly, whenever a recent commit causes compilation problems, this is a problem for us too, because we have to patch the library on our side.

Could you please consider either using github releases to provide library snapshots with versions (eg, safestringlib 1.0, 1.1), or moving development to another branch, which would be merged to the master branch after the changes are complete, tested and verified?

heap-buffer-overflow in strisascii_s

in strisascii_s starting on line 101:

101 while (*dest && dmax) {  
102        if ((unsigned char)*dest > 127) {  
103            return (false);  
104        }  
105        dest++;  
106        dmax--;  
107    } 

When the pointer to dest is moved past the end of the array on line 105, it is de-referenced on 101 before the control check of dmax.

Found using clang AddressSantizier and LibFuzzer. I have a fix I will be pushing to my fork.

fails to compile

commit 961c608

gcc -c -o objtest/test_memcmp16_s.o unittests/test_memcmp16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
In file included from include/safe_lib.h:59:0,
from include/safe_mem_lib.h:36,
from unittests/test_memcmp16_s.c:8:
include/safe_str_lib.h:268:8: error: unknown type name ‘wchar_t’
extern wchar_t *
^~~~~~~
include/safe_str_lib.h:269:10: error: unknown type name ‘wchar_t’; did you mean ‘__gwchar_t’?
wcpcpy_s(wchar_t* dest, rsize_t dmax, const wchar_t* src, errno_t err);
^~~~~~~
__gwchar_t
include/safe_str_lib.h:269:45: error: unknown type name ‘wchar_t’
wcpcpy_s(wchar_t
dest, rsize_t dmax, const wchar_t* src, errno_t err);
^~~~~~~
include/safe_str_lib.h:273:10: error: unknown type name ‘wchar_t’; did you mean ‘__gwchar_t’?
wcscat_s(wchar_t
dest, rsize_t dmax, const wchar_t* src);
^~~~~~~
__gwchar_t
include/safe_str_lib.h:273:45: error: unknown type name ‘wchar_t’
wcscat_s(wchar_t* dest, rsize_t dmax, const wchar_t* src);
^~~~~~~
include/safe_str_lib.h:277:11: error: unknown type name ‘wchar_t’; did you mean ‘__gwchar_t’?
wcsncat_s(wchar_t dest, rsize_t dmax, const wchar_t src, rsize_t slen);
^~~~~~~
__gwchar_t
include/safe_str_lib.h:277:46: error: unknown type name ‘wchar_t’
wcsncat_s(wchar_t dest, rsize_t dmax, const wchar_t src, rsize_t slen);
^~~~~~~
include/safe_str_lib.h:281:10: error: unknown type name ‘wchar_t’; did you mean ‘__gwchar_t’?
wcscpy_s(wchar_t
dest, rsize_t dmax, const wchar_t
src);
^~~~~~~
__gwchar_t
include/safe_str_lib.h:281:45: error: unknown type name ‘wchar_t’
wcscpy_s(wchar_t
dest, rsize_t dmax, const wchar_t
src);
^~~~~~~
include/safe_str_lib.h:285:11: error: unknown type name ‘wchar_t’; did you mean ‘__gwchar_t’?
wcsncpy_s(wchar_t* dest, rsize_t dmax, const wchar_t* src, rsize_t slen);
^~~~~~~
__gwchar_t
include/safe_str_lib.h:285:46: error: unknown type name ‘wchar_t’
wcsncpy_s(wchar_t* dest, rsize_t dmax, const wchar_t* src, rsize_t slen);
^~~~~~~
include/safe_str_lib.h:289:17: error: unknown type name ‘wchar_t’
wcsnlen_s(const wchar_t *dest, rsize_t dmax);
^~~~~~~
make: *** [makefile:47: objtest/test_memcmp16_s.o] Error 1

Crash in safestringtest on ubuntu 16.04

cian@sourdough:~/Workspaces/safestringlib$ ./safestringtest
!!!Basic Test Suite for Safe String Operations!!!
       ERRORS PRINT TO CONSOLE
----------------BEGIN TEST--------------------

Testing stpncpy_s:
Test #1:
Test #2:
Test #3:
Test #4:
Test #5:
Test #6:
Test #7:
Test #8:
Test #9:
Test #10:
Test #11:
Test #12:
Test #13:
Test #14:
Test #15:
Test #16:

Testing stpncpy_s:
Test #1:
Test #2:
Test #3:
Test #4:
Test #5:
Test #6:
Test #7:
Test #8:
Test #9:
Test #10:
Test #11:
Test #12:
Test #13:
Test #14:
Test #15:
Test #16:
Test #17:
Test #18:
Test #19:
*** stack smashing detected ***: ./safestringtest terminated
Aborted (core dumped)
cian@sourdough:~/Workspaces/safestringlib$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cian@sourdough:~/Workspaces/safestringlib$ lsb_release --a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial

Full console log:
---------------------------------------------------------------------------------------
cian@sourdough:~/Workspaces$ git clone [email protected]:intel/safestringlib.git
Cloning into 'safestringlib'...
remote: Counting objects: 196, done.
remote: Total 196 (delta 0), reused 0 (delta 0), pack-reused 196
Receiving objects: 100% (196/196), 119.92 KiB | 0 bytes/s, done.
Resolving deltas: 100% (141/141), done.
Checking connectivity... done.
cian@sourdough:~/Workspaces$ mkdir -p obj objtest
cian@sourdough:~/Workspaces$ make all
make: *** No rule to make target 'all'.  Stop.
cian@sourdough:~/Workspaces$ rm -rf obj objtest/
cian@sourdough:~/Workspaces$ cd safestringlib/
cian@sourdough:~/Workspaces/safestringlib$ mkdir -p obj objtest
cian@sourdough:~/Workspaces/safestringlib$ make all
gcc -z noexecstack -z relo -z now -c -o obj/abort_handler_s.o safeclib/abort_handler_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
In file included from safeclib/abort_handler_s.c:32:0:
safeclib/abort_handler_s.c: In function ‘abort_handler_s’:
safeclib/safeclib_private.h:80:23: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration]
 #define slabort()     abort()
                       ^
safeclib/abort_handler_s.c:72:2: note: in expansion of macro ‘slabort’
  slabort();
  ^
safeclib/safeclib_private.h:80:23: warning: incompatible implicit declaration of built-in function ‘abort’
 #define slabort()     abort()
                       ^
safeclib/abort_handler_s.c:72:2: note: in expansion of macro ‘slabort’
  slabort();
  ^
safeclib/safeclib_private.h:80:23: note: include ‘<stdlib.h>’ or provide a declaration of ‘abort’
 #define slabort()     abort()
                       ^
safeclib/abort_handler_s.c:72:2: note: in expansion of macro ‘slabort’
  slabort();
  ^
gcc -z noexecstack -z relo -z now -c -o obj/stpcpy_s.o safeclib/stpcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strlastsame_s.o safeclib/strlastsame_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/ignore_handler_s.o safeclib/ignore_handler_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/stpncpy_s.o safeclib/stpncpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strljustify_s.o safeclib/strljustify_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memcmp16_s.o safeclib/memcmp16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcasecmp_s.o safeclib/strcasecmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
safeclib/strcasecmp_s.c: In function ‘strcasecmp_s’:
safeclib/strcasecmp_s.c:132:13: warning: implicit declaration of function ‘toupper’ [-Wimplicit-function-declaration]
         if (toupper(*udest) != toupper(*usrc)) {
             ^
gcc -z noexecstack -z relo -z now -c -o obj/strncat_s.o safeclib/strncat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memcmp32_s.o safeclib/memcmp32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcasestr_s.o safeclib/strcasestr_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
safeclib/strcasestr_s.c: In function ‘strcasestr_s’:
safeclib/strcasestr_s.c:156:17: warning: implicit declaration of function ‘toupper’ [-Wimplicit-function-declaration]
             if (toupper(dest[i]) != toupper(src[i])) {
                 ^
gcc -z noexecstack -z relo -z now -c -o obj/strncpy_s.o safeclib/strncpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memcmp_s.o safeclib/memcmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcat_s.o safeclib/strcat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strnlen_s.o safeclib/strnlen_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memcpy16_s.o safeclib/memcpy16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcmpfld_s.o safeclib/strcmpfld_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strnterminate_s.o safeclib/strnterminate_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memcpy32_s.o safeclib/memcpy32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcmp_s.o safeclib/strcmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strpbrk_s.o safeclib/strpbrk_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memcpy_s.o safeclib/memcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcpyfldin_s.o safeclib/strcpyfldin_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strprefix_s.o safeclib/strprefix_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memmove16_s.o safeclib/memmove16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcpyfldout_s.o safeclib/strcpyfldout_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strremovews_s.o safeclib/strremovews_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memmove32_s.o safeclib/memmove32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcpyfld_s.o safeclib/strcpyfld_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strspn_s.o safeclib/strspn_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memmove_s.o safeclib/memmove_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcpy_s.o safeclib/strcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strstr_s.o safeclib/strstr_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/mem_primitives_lib.o safeclib/mem_primitives_lib.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strcspn_s.o safeclib/strcspn_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strtok_s.o safeclib/strtok_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strfirstchar_s.o safeclib/strfirstchar_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strtolowercase_s.o safeclib/strtolowercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memset16_s.o safeclib/memset16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strfirstdiff_s.o safeclib/strfirstdiff_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strtouppercase_s.o safeclib/strtouppercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memset32_s.o safeclib/memset32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strfirstsame_s.o safeclib/strfirstsame_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strzero_s.o safeclib/strzero_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memset_s.o safeclib/memset_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strisalphanumeric_s.o safeclib/strisalphanumeric_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wcpcpy_s.o safeclib/wcpcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memzero16_s.o safeclib/memzero16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strisascii_s.o safeclib/strisascii_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wcscat_s.o safeclib/wcscat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memzero32_s.o safeclib/memzero32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strisdigit_s.o safeclib/strisdigit_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wcscpy_s.o safeclib/wcscpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/memzero_s.o safeclib/memzero_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strishex_s.o safeclib/strishex_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wcsncat_s.o safeclib/wcsncat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strislowercase_s.o safeclib/strislowercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wcsncpy_s.o safeclib/wcsncpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/safe_mem_constraint.o safeclib/safe_mem_constraint.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strismixedcase_s.o safeclib/strismixedcase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wcsnlen_s.o safeclib/wcsnlen_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strispassword_s.o safeclib/strispassword_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wmemcmp_s.o safeclib/wmemcmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/safe_str_constraint.o safeclib/safe_str_constraint.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strisuppercase_s.o safeclib/strisuppercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wmemcpy_s.o safeclib/wmemcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strlastchar_s.o safeclib/strlastchar_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wmemmove_s.o safeclib/wmemmove_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/snprintf_support.o safeclib/snprintf_support.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/strlastdiff_s.o safeclib/strlastdiff_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -c -o obj/wmemset_s.o safeclib/wmemset_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
ar rcs libsafestring.a obj/abort_handler_s.o obj/stpcpy_s.o obj/strlastsame_s.o obj/ignore_handler_s.o obj/stpncpy_s.o obj/strljustify_s.o obj/memcmp16_s.o obj/strcasecmp_s.o obj/strncat_s.o obj/memcmp32_s.o obj/strcasestr_s.o obj/strncpy_s.o obj/memcmp_s.o obj/strcat_s.o obj/strnlen_s.o obj/memcpy16_s.o obj/strcmpfld_s.o obj/strnterminate_s.o obj/memcpy32_s.o obj/strcmp_s.o obj/strpbrk_s.o obj/memcpy_s.o obj/strcpyfldin_s.o obj/strprefix_s.o obj/memmove16_s.o obj/strcpyfldout_s.o obj/strremovews_s.o obj/memmove32_s.o obj/strcpyfld_s.o obj/strspn_s.o obj/memmove_s.o obj/strcpy_s.o obj/strstr_s.o obj/mem_primitives_lib.o obj/strcspn_s.o obj/strtok_s.o obj/strfirstchar_s.o obj/strtolowercase_s.o obj/memset16_s.o obj/strfirstdiff_s.o obj/strtouppercase_s.o obj/memset32_s.o obj/strfirstsame_s.o obj/strzero_s.o obj/memset_s.o obj/strisalphanumeric_s.o obj/wcpcpy_s.o obj/memzero16_s.o obj/strisascii_s.o obj/wcscat_s.o obj/memzero32_s.o obj/strisdigit_s.o obj/wcscpy_s.o obj/memzero_s.o obj/strishex_s.o obj/wcsncat_s.o obj/strislowercase_s.o obj/wcsncpy_s.o obj/safe_mem_constraint.o obj/strismixedcase_s.o obj/wcsnlen_s.o obj/strispassword_s.o obj/wmemcmp_s.o obj/safe_str_constraint.o obj/strisuppercase_s.o obj/wmemcpy_s.o obj/strlastchar_s.o obj/wmemmove_s.o obj/snprintf_support.o obj/strlastdiff_s.o obj/wmemset_s.o
gcc -c -o objtest/Safe_String_UnitTestMain.o unittests/Safe_String_UnitTestMain.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcmp_s.o unittests/test_strcmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strnlen_s.o unittests/test_strnlen_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strnlen_s.c: In function ‘test_strnlen_s’:
unittests/test_strnlen_s.c:24:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   Len=%u \n",
                ^
unittests/test_strnlen_s.c:33:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   Len=%u \n",
                ^
unittests/test_strnlen_s.c:42:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   Len=%u \n",
                ^
unittests/test_strnlen_s.c:54:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnlen_s.c:54:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnlen_s.c:66:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnlen_s.c:66:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnlen_s.c:78:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnlen_s.c:78:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnlen_s.c:90:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnlen_s.c:90:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnlen_s.c:100:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
unittests/test_strnlen_s.c:110:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
unittests/test_strnlen_s.c:120:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
gcc -c -o objtest/test_memcmp16_s.o unittests/test_memcmp16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcpyfldin_s.o unittests/test_strcpyfldin_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strnterminate_s.o unittests/test_strnterminate_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strnterminate_s.c: In function ‘test_strnterminate_s’:
unittests/test_strnterminate_s.c:28:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   Len=%u \n",
                ^
unittests/test_strnterminate_s.c:38:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   Len=%u \n",
                ^
unittests/test_strnterminate_s.c:48:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   Len=%u \n",
                ^
unittests/test_strnterminate_s.c:61:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnterminate_s.c:61:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnterminate_s.c:71:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnterminate_s.c:71:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnterminate_s.c:82:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnterminate_s.c:82:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnterminate_s.c:93:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnterminate_s.c:93:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnterminate_s.c:104:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnterminate_s.c:104:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnterminate_s.c:115:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   std_len=%u  len=%u  \n",
                ^
unittests/test_strnterminate_s.c:115:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 5 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
unittests/test_strnterminate_s.c:126:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
unittests/test_strnterminate_s.c:137:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
unittests/test_strnterminate_s.c:148:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
unittests/test_strnterminate_s.c:159:16: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u   len=%u  \n",
                ^
unittests/test_strnterminate_s.c:172:20: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
             printf("%s %u   len=%u  \n",
                    ^
gcc -c -o objtest/test_memcmp32_s.o unittests/test_memcmp32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcpyfldout_s.o unittests/test_strcpyfldout_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strpbrk_s.o unittests/test_strpbrk_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memcmp_s.o unittests/test_memcmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcpyfld_s.o unittests/test_strcpyfld_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strprefix_s.o unittests/test_strprefix_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memcpy16_s.o unittests/test_memcpy16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcpy_s.o unittests/test_strcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strremovews_s.o unittests/test_strremovews_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memcpy32_s.o unittests/test_memcpy32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcspn_s.o unittests/test_strcspn_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strcspn_s.c: In function ‘test_strcspn_s’:
unittests/test_strcspn_s.c:25:42: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(NULL, LEN, str2, LEN, &count);
                                          ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:38:42: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, LEN, NULL, LEN, &count);
                                          ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:59:40: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, 0, str2, LEN, &count);
                                        ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:72:40: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, LEN, str2, 0, &count);
                                        ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:85:54: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, RSIZE_MAX_STR+1, str2, LEN, &count);
                                                      ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:98:64: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, RSIZE_MAX_STR, str2, RSIZE_MAX_STR+1, &count);
                                                                ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:114:42: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, LEN, str2, LEN, &count);
                                          ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:136:40: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, 1, str2, LEN, &count);
                                        ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:152:40: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, 2, str2, LEN, &count);
                                        ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:168:40: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, 3, str2, LEN, &count);
                                        ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:185:40: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, 6, str2, LEN, &count);
                                        ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:201:38: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, 6, str2, 2, &count);
                                      ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:217:42: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, LEN, str2, LEN, &count);
                                          ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:234:42: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, LEN, str2, LEN, &count);
                                          ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
unittests/test_strcspn_s.c:251:42: warning: passing argument 5 of ‘strcspn_s’ from incompatible pointer type [-Wincompatible-pointer-types]
     rc = strcspn_s(str1, LEN, str2, LEN, &count);
                                          ^
In file included from unittests/test_strcspn_s.c:9:0:
include/safe_str_lib.h:115:1: note: expected ‘rsize_t * {aka long unsigned int *}’ but argument is of type ‘uint32_t * {aka unsigned int *}’
 strcspn_s(const char *dest, rsize_t dmax,
 ^
gcc -c -o objtest/test_strspn_s.o unittests/test_strspn_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strspn_s.c: In function ‘test_strspn_s’:
unittests/test_strspn_s.c:33:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:46:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:67:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:80:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:93:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:106:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:122:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  count=%d rc=%d \n",
                ^
unittests/test_strspn_s.c:138:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:154:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:170:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:187:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:204:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:222:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:239:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:256:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
unittests/test_strspn_s.c:273:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  count=%d  std_count=%d  rc=%d \n",
                ^
gcc -c -o objtest/test_memcpy_s.o unittests/test_memcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_memcpy_s.c: In function ‘test_memcpy_s’:
unittests/test_memcpy_s.c:90:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%d - %d m1=%d  m2=%d  \n",
                ^
unittests/test_memcpy_s.c:117:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%d - %d m1=%d  m2=%d  \n",
                ^
unittests/test_memcpy_s.c:144:20: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
             printf("%d - %d m1=%d  m2=%d  \n",
                    ^
unittests/test_memcpy_s.c:171:20: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
             printf("%d - %d m1=%d  m2=%d  \n",
                    ^
gcc -c -o objtest/test_strfirstchar_s.o unittests/test_strfirstchar_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strstr_s.o unittests/test_strstr_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memmove16_s.o unittests/test_memmove16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strfirstdiff_s.o unittests/test_strfirstdiff_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strfirstdiff_s.c: In function ‘test_strfirstdiff_s’:
unittests/test_strfirstdiff_s.c:32:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:45:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:66:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:79:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:95:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:111:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:127:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:143:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:158:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:174:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:190:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:206:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstdiff_s.c:222:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
gcc -c -o objtest/test_strtok_s.o unittests/test_strtok_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memmove32_s.o unittests/test_memmove32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strfirstsame_s.o unittests/test_strfirstsame_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strfirstsame_s.c: In function ‘test_strfirstsame_s’:
unittests/test_strfirstsame_s.c:32:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:45:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:66:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:79:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:95:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:111:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:127:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:143:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:159:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:175:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:186:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:191:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:202:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:207:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:218:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:223:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:234:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strfirstsame_s.c:239:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
gcc -c -o objtest/test_strtolowercase_s.o unittests/test_strtolowercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memmove_s.o unittests/test_memmove_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strisalphanumeric_s.o unittests/test_strisalphanumeric_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strtouppercase_s.o unittests/test_strtouppercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memset16_s.o unittests/test_memset16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strisascii_s.o unittests/test_strisascii_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strzero_s.o unittests/test_strzero_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memset32_s.o unittests/test_memset32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strisdigit_s.o unittests/test_strisdigit_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wcpcpy_s.o unittests/test_wcpcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_wcpcpy_s.c: In function ‘test_wcpcpy_s’:
unittests/test_wcpcpy_s.c:143:4: warning: implicit declaration of function ‘wcscpy_s’ [-Wimplicit-function-declaration]
    wcscpy_s(str1, LEN, L"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
    ^
unittests/test_wcpcpy_s.c:201:52: warning: implicit declaration of function ‘wcsnlen_s’ [-Wimplicit-function-declaration]
  if (ret == NULL || ret[0] != L'\0' || ret != str1+wcsnlen_s(str1, LEN) ) {
                                                    ^
gcc -c -o objtest/test_memset_s.o unittests/test_memset_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strishex_s.o unittests/test_strishex_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wcscat_s.o unittests/test_wcscat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memzero16_s.o unittests/test_memzero16_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strislowercase_s.o unittests/test_strislowercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wcscpy_s.o unittests/test_wcscpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_wcscpy_s.c: In function ‘test_wcscpy_s’:
unittests/test_wcscpy_s.c:214:7: warning: implicit declaration of function ‘wcsnlen_s’ [-Wimplicit-function-declaration]
  sz = wcsnlen_s(str1, LEN);
       ^
unittests/test_wcscpy_s.c:312:5: warning: implicit declaration of function ‘wmemset_s’ [-Wimplicit-function-declaration]
     wmemset_s(str1, L'x', 20);
     ^
gcc -c -o objtest/test_memzero32_s.o unittests/test_memzero32_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strismixed_s.o unittests/test_strismixed_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wcsncat_s.o unittests/test_wcsncat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_memzero_s.o unittests/test_memzero_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strispassword_s.o unittests/test_strispassword_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wcsncpy_s.o unittests/test_wcsncpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strisuppercase_s.o unittests/test_strisuppercase_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wcsnlen_s.o unittests/test_wcsnlen_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_stpcpy_s.o unittests/test_stpcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strlastchar_s.o unittests/test_strlastchar_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wmemcmp_s.o unittests/test_wmemcmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_stpncpy_s.o unittests/test_stpncpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_stpncpy_s.c: In function ‘test_stpncpy_s’:
unittests/test_stpncpy_s.c:359:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u -%s- <> -%s-  (smax=%d) Error rc=%u \n",
                ^
unittests/test_stpncpy_s.c:390:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 6 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u -%s- <> -%s-  (smax=%d) Error rc=%u \n",
                ^
gcc -c -o objtest/test_strlastdiff_s.o unittests/test_strlastdiff_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strlastdiff_s.c: In function ‘test_strlastdiff_s’:
unittests/test_strlastdiff_s.c:33:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:46:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:67:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:80:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:96:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:112:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:128:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:144:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:159:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:175:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastdiff_s.c:191:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
gcc -c -o objtest/test_wmemcpy_s.o unittests/test_wmemcpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcasecmp_s.o unittests/test_strcasecmp_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strlastsame_s.o unittests/test_strlastsame_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strlastsame_s.c: In function ‘test_strlastsame_s’:
unittests/test_strlastsame_s.c:32:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastsame_s.c:45:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastsame_s.c:66:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastsame_s.c:79:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastsame_s.c:95:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error  ind=%d rc=%d \n",
                ^
unittests/test_strlastsame_s.c:111:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:127:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:143:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:159:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:170:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:175:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:186:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:191:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:202:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:207:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:218:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:223:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:234:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
unittests/test_strlastsame_s.c:239:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘rsize_t {aka long unsigned int}’ [-Wformat=]
         printf("%s %u  Error ind=%d  rc=%d \n",
                ^
gcc -c -o objtest/test_wmemmove_s.o unittests/test_wmemmove_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_wmemmove_s.c: In function ‘test_wmemmove_s’:
unittests/test_wmemmove_s.c:407:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  rc = wmemmove_s((wchar_t)(((char *)mem1)+1), LEN, mem2, 10);
                  ^
unittests/test_wmemmove_s.c:407:18: warning: passing argument 1 of ‘wmemmove_s’ makes pointer from integer without a cast [-Wint-conversion]
unittests/test_wmemmove_s.c:76:16: note: expected ‘wchar_t * {aka int *}’ but argument is of type ‘int’
 extern errno_t wmemmove_s(wchar_t* dest, rsize_t dmax, const wchar_t* src, size_t smax);
                ^
unittests/test_wmemmove_s.c:433:18: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  rc = wmemmove_s((wchar_t)(((char *)mem1)+2), LEN, mem2, 10);
                  ^
unittests/test_wmemmove_s.c:433:18: warning: passing argument 1 of ‘wmemmove_s’ makes pointer from integer without a cast [-Wint-conversion]
unittests/test_wmemmove_s.c:76:16: note: expected ‘wchar_t * {aka int *}’ but argument is of type ‘int’
 extern errno_t wmemmove_s(wchar_t* dest, rsize_t dmax, const wchar_t* src, size_t smax);
                ^
gcc -c -o objtest/test_strcasestr_s.o unittests/test_strcasestr_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
unittests/test_strcasestr_s.c: In function ‘test_strcasestr_s’:
unittests/test_strcasestr_s.c:130:15: warning: implicit declaration of function ‘strcasestr’ [-Wimplicit-function-declaration]
     std_sub = strcasestr(str1, str2);
               ^
unittests/test_strcasestr_s.c:130:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     std_sub = strcasestr(str1, str2);
             ^
unittests/test_strcasestr_s.c:131:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
         ^
unittests/test_strcasestr_s.c:131:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
                     ^
unittests/test_strcasestr_s.c:136:10: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘char *’ [-Wformat=]
   printf("strcasestr_s returns:[%x]\n", sub);
          ^
unittests/test_strcasestr_s.c:137:10: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘char *’ [-Wformat=]
   printf("strcasestr   returns:[%x]\n\n", std_sub);
          ^
unittests/test_strcasestr_s.c:157:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     std_sub = strcasestr(str1, str2);
             ^
unittests/test_strcasestr_s.c:158:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
         ^
unittests/test_strcasestr_s.c:158:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
                     ^
unittests/test_strcasestr_s.c:163:10: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘char *’ [-Wformat=]
   printf("strcasestr_s returns:[%x]\n", sub);
          ^
unittests/test_strcasestr_s.c:164:10: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘char *’ [-Wformat=]
   printf("strcasestr   returns:[%x]\n\n", std_sub);
          ^
unittests/test_strcasestr_s.c:185:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     std_sub = strcasestr(str1, str2);
             ^
unittests/test_strcasestr_s.c:186:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
         ^
unittests/test_strcasestr_s.c:186:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
                     ^
unittests/test_strcasestr_s.c:267:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     std_sub = strcasestr(str1, str2);
             ^
unittests/test_strcasestr_s.c:268:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
         ^
unittests/test_strcasestr_s.c:268:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
                     ^
unittests/test_strcasestr_s.c:298:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     std_sub = strcasestr(str1, str2);
             ^
unittests/test_strcasestr_s.c:299:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
         ^
unittests/test_strcasestr_s.c:299:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
                     ^
unittests/test_strcasestr_s.c:423:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     std_sub = strcasestr(str1, str2);
             ^
unittests/test_strcasestr_s.c:424:9: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
         ^
unittests/test_strcasestr_s.c:424:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     if ((int)sub != (int)std_sub) { // comparison to handle 32-bit library return and 64-bit library r
                     ^
gcc -c -o objtest/test_strljustify_s.o unittests/test_strljustify_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_wmemset_s.o unittests/test_wmemset_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcat_s.o unittests/test_strcat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strncat_s.o unittests/test_strncat_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strcmpfld_s.o unittests/test_strcmpfld_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -c -o objtest/test_strncpy_s.o unittests/test_strncpy_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
gcc -z noexecstack -z relo -z now -static -o safestringtest objtest/Safe_String_UnitTestMain.o objtest/test_strcmp_s.o objtest/test_strnlen_s.o objtest/test_memcmp16_s.o objtest/test_strcpyfldin_s.o objtest/test_strnterminate_s.o objtest/test_memcmp32_s.o objtest/test_strcpyfldout_s.o objtest/test_strpbrk_s.o objtest/test_memcmp_s.o objtest/test_strcpyfld_s.o objtest/test_strprefix_s.o objtest/test_memcpy16_s.o objtest/test_strcpy_s.o objtest/test_strremovews_s.o objtest/test_memcpy32_s.o objtest/test_strcspn_s.o objtest/test_strspn_s.o objtest/test_memcpy_s.o objtest/test_strfirstchar_s.o objtest/test_strstr_s.o objtest/test_memmove16_s.o objtest/test_strfirstdiff_s.o objtest/test_strtok_s.o objtest/test_memmove32_s.o objtest/test_strfirstsame_s.o objtest/test_strtolowercase_s.o objtest/test_memmove_s.o objtest/test_strisalphanumeric_s.o objtest/test_strtouppercase_s.o objtest/test_memset16_s.o objtest/test_strisascii_s.o objtest/test_strzero_s.o objtest/test_memset32_s.o objtest/test_strisdigit_s.o objtest/test_wcpcpy_s.o objtest/test_memset_s.o objtest/test_strishex_s.o objtest/test_wcscat_s.o objtest/test_memzero16_s.o objtest/test_strislowercase_s.o objtest/test_wcscpy_s.o objtest/test_memzero32_s.o objtest/test_strismixed_s.o objtest/test_wcsncat_s.o objtest/test_memzero_s.o objtest/test_strispassword_s.o objtest/test_wcsncpy_s.o objtest/test_strisuppercase_s.o objtest/test_wcsnlen_s.o objtest/test_stpcpy_s.o objtest/test_strlastchar_s.o objtest/test_wmemcmp_s.o objtest/test_stpncpy_s.o objtest/test_strlastdiff_s.o objtest/test_wmemcpy_s.o objtest/test_strcasecmp_s.o objtest/test_strlastsame_s.o objtest/test_wmemmove_s.o objtest/test_strcasestr_s.o objtest/test_strljustify_s.o objtest/test_wmemset_s.o objtest/test_strcat_s.o objtest/test_strncat_s.o objtest/test_strcmpfld_s.o objtest/test_strncpy_s.o libsafestring.a
/usr/bin/ld: warning: -z relo ignored.
cian@sourdough:~/Workspaces/safestringlib$ ./safestringtest
!!!Basic Test Suite for Safe String Operations!!!
       ERRORS PRINT TO CONSOLE
----------------BEGIN TEST--------------------

Testing stpncpy_s:
Test #1:
Test #2:
Test #3:
Test #4:
Test #5:
Test #6:
Test #7:
Test #8:
Test #9:
Test #10:
Test #11:
Test #12:
Test #13:
Test #14:
Test #15:
Test #16:

Testing stpncpy_s:
Test #1:
Test #2:
Test #3:
Test #4:
Test #5:
Test #6:
Test #7:
Test #8:
Test #9:
Test #10:
Test #11:
Test #12:
Test #13:
Test #14:
Test #15:
Test #16:
Test #17:
Test #18:
Test #19:
*** stack smashing detected ***: ./safestringtest terminated
Aborted (core dumped)
cian@sourdough:~/Workspaces/safestringlib$ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cian@sourdough:~/Workspaces/safestringlib$ lsb_release --a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.3 LTS
Release:        16.04
Codename:       xenial
cian@sourdough:~/Workspaces/safestringlib$

Building as kernel module - blocking issues

Few issues raised from compiling this library as a kernel module (according to the macros in the code, the original authors prepared the code for compiling in kernel).

1. Unicode is unsupported in kernel, all wchar usage should be "macroed" out.
2. All EXPORT_SYMBOL statements should be ended with semicolon.
3. Kernel checkpatch found "3375 errors, 4232 warnings" coding style issues, they should be fixed to let developers to integrate this library code in their kernel modules.

Please fix those issues for full competability with kernel build.

Issues with CMake and FetchContent_Declare

I tried using this project with my CMakefile but it doesn't work

include(FetchContent)
FetchContent_Declare(
  safestringlib
  GIT_REPOSITORY https://github.com/intel/safestringlib.git
  GIT_TAG master)
  
set(BUILD_UNITTESTS
OFF
CACHE BOOL "" FORCE)

FetchContent_MakeAvailable(safestringlib)
target_link_libraries(crc32_crc32 PRIVATE safestringlib)

I have these errors:

/crc32/crc32.h:20:10: erreur fatale: safe_lib.h : Aucun fichier ou dossier de ce type
   20 | #include "safe_lib.h"
      |          ^~~~~~~~~~~~
/crc32/crc32.h:20:10: erreur fatale: safe_str_lib.h : Aucun fichier ou dossier de ce type
   20 | #include "safe_str_lib.h"
      |          ^~~~~~~~~~~~

Not able to compile with icpc

$ make
icpc -z noexecstack -z relo -z now -c -o obj/abort_handler_s.o safeclib/abort_handler_s.c -Iinclude -fstack-protector-strong -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security
safeclib/abort_handler_s.c(72): error: identifier "abort" is undefined
slabort();
^

compilation aborted for safeclib/abort_handler_s.c (code 2)
make: *** [obj/abort_handler_s.o] Error 2

Non-ASCII chars in comments

Should remove non-ASCII chars as they can cause some compilers to error out
To reproduce:

git clone https://github.com/intel/safestringlib
cd safestringlib
grep --color='auto' -P -n "[^\x00-\x7f]" ./safeclib/*.c

You should see something like:

./safeclib/memcpy16_s.c:77: * zeros in the first dmax bytes of the object pointed to by dest
./safeclib/memcpy32_s.c:76: * zeros in the first dmax bytes of the object pointed to by dest
./safeclib/memcpy_s.c:75: * stores zeros in the first dmax bytes of the region pointed to
./safeclib/memmove16_s.c:52: * pointed to by src are first copied into a temporary array of
./safeclib/memmove16_s.c:81: * stores zeros in the first dmax characters of the regionpointed to
./safeclib/memmove32_s.c:52: * pointed to by src are first copied into a temporary array of
./safeclib/memmove32_s.c:81: * stores zeros in the first dmax characters of the regionpointed to
./safeclib/memmove_s.c:51: * as if the smax bytes from the region pointed to by src are first copied
./safeclib/memmove_s.c:80: * stores zeros in the first dmax characters of the regionpointed to
./safeclib/strcat_s.c:54: * pointed to by dest take unspecified values when strcat_s
./safeclib/strncat_s.c:54: * pointed to by dest take unspecified values when strncat_s returns.
./safeclib/strtok_s.c:58: * ptr and updates the value pointed to by dmax to reflect the
./safeclib/strtok_s.c:82: * In all cases, the strtok_s function stores sufficient information
./safeclib/strtok_s.c:84: * with a null pointer for dest and the unmodified pointer value
./safeclib/wcscat_s.c:54: * pointed to by dest take unspecified values when strcat_s
./safeclib/wcsncat_s.c:58: * pointed to by dest take unspecified values when strncat_s returns.
./safeclib/wmemcpy_s.c:76: * stores zeros in the first dmax bytes of the region pointed to
./safeclib/wmemmove_s.c:51: * as if the smax wide characters from the region pointed to by src are first copied
./safeclib/wmemmove_s.c:80: * stores zeros in the first dmax characters of the region pointed to

uint8_t pointers

At multiple places throughout the library, uint8_t* is used to access bytes of memory (See here, here, …). However, this is invalid as by section 6.2.5 of the C11 standard only char and variants thereof are considered character types, enjoying the privilege of being able to point to any object of any type. Thus, the implemented practice is technically undefined behavior.

Autoconf Support

The makefile is brittle when it comes to platform independence. We should really use something like autoconf to make the builds more flexible. I'll put something together and submit a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.