Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

various fixes #49

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

various fixes #49

wants to merge 4 commits into from

Conversation

sharkcz
Copy link

@sharkcz sharkcz commented Jun 1, 2022

  • fix 3 warnings from builds on Fedora with GCC 11
  • allow compilation with user supplied CFLAGS

The nocase_strcmp() and nocase_strncmp() functions are correctly returning
an integer value, let the declarations match the definitions.
fixes the following:

In file included from /usr/include/string.h:519,
                 from coff.c:35:
In function 'strncpy',
    inlined from 'stab_add_filename' at coff.c:890:3:
/usr/include/bits/string_fortified.h:95:10: warning: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
   95 |   return __builtin___strncpy_chk (__dest, __src, __len,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |                                   __glibc_objsize (__dest));
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~
coff.c: In function 'stab_add_filename':
coff.c:859:13: note: length computed here
  859 |         n = strlen(pName);
      |             ^~~~~~~~~~~~~
The temp variable is used incorrectly in the strncmp() calls, they should
compare against the line variable.
Adding CDEFS to CFLAGS in Makefile needs an override directive to allow
user supplied CFLAGS to be used.

http://www.gnu.org/software/make/manual/make.html#Override-Directive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant