[Bug 263544] sysutils/pesign: Fails to build with GCC 11: error: 'free' called on a pointer to an unallocated object '"NSS Certificate DB"' [-Werror=free-nonheap-object]

From: <bugzilla-noreply_at_freebsd.org>
Date: Sun, 24 Apr 2022 22:27:39 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263544

            Bug ID: 263544
           Summary: sysutils/pesign: Fails to build with GCC 11: error:
                    'free' called on a pointer to an unallocated object
                    '"NSS Certificate DB"' [-Werror=free-nonheap-object]
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
               URL: http://package18.nyi.freebsd.org/data/122amd64-default
                    -foo/2021-09-18_18h41m21s/logs/errors/pesign-0.110_8.l
                    og
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: salvadore@freebsd.org
            Blocks: 258378

Updating GCC_DEFAULT from GCC 10 to GCC 11 is blocked by the fact that building
this port with GCC 11 gives the following error (full log in URL):

gcc11 -I/wrkdirs/usr/ports/sysutils/pesign/work/pesign-0.110/include -O2 -pipe 
-fstack-protector-strong -Wl,-rpath=/usr/local/lib/gcc11 -isystem
/usr/local/include -fno-strict-aliasing  -g -O0 -g -O0  -Wall -fshort-wchar
-fno-strict-aliasing -fno-merge-constants --std=gnu99 -D_GNU_SOURCE
-Wno-unused-result -Wno-unused-function -I../include/  -I/usr/local/include
-I/usr/local/include/nss -I/usr/local/include/nspr  -Werror -fPIC -isystem
/usr/local/include -DCONFIG_amd64 -DCONFIG_amd64 -c authvar_context.c -o
authvar_context.o
authvar.c: In function 'main':
authvar.c:344:17: error: 'free' called on a pointer to an unallocated object
'"NSS Certificate DB"' [-Werror=free-nonheap-object]
  344 |                 free(tokenname);
      |                 ^~~~~~~~~~~~~~~
authvar.c:217:15: note: assigned here
  217 |         char *tokenname = "NSS Certificate DB";
      |               ^~~~~~~~~
cc1: all warnings being treated as errors

Also, it should be checked if USE_GCC is still needed and that the default
clang compiler can't be used instead.


Referenced Bugs:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=258378
[Bug 258378] [exp-run] Update GCC_DEFAULT from 10 to 11
-- 
You are receiving this mail because:
You are the assignee for the bug.