TIP: Click on subject to list as thread! ANSI
echo: mbse
to: All
from: James Digriz
date: 2020-09-02 17:59:00
subject: GCC 8.3 compiler warnings

Anyone else tried compiling on 8? Goes to completion but I'm getting piles of
warnings about string truncation and such. Eg: 

.
.
.

log.c: In function `dolastlog':
log.c:89:2: warning: `strncpy' specified bound 32 equals destination size
[-Wstringop-truncation]
  strncpy(newlog.ll_line, line, sizeof newlog.ll_line);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gcc -O2 -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings 
-Wstrict-prototypes
-D_REENTRANT -I/usr/local/include   -c setugid.c
gcc -O2 -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings 
-Wstrict-prototypes
-D_REENTRANT -I/usr/local/include   -c mblogin.c
In file included from mblogin.c:32:
mblogin.c: In function `main':
mblogin.c:541:44: warning: `%s' directive output may be truncated writing
up to 8191 bytes into a region of size 507 [-Wformat-truncation=]
      snprintf(fromhost, sizeof fromhost, _(" on `%s' from `%s'"), tty, cp);
                                            ^~~~~~~~~~~~~~~~~~~~
.
.
.

Presumably this might be something to be concerned about, but I haven't tried
running the resulting code yet, and won't run it as a production system until
somebody with more current gcc knowledge than mine weighs in.

Appreciate any input,
jbdigriz    
                     

    Greetings, James Digriz
    email: jbdigriz@bbs.dragonsweb.org

--- MBSE BBS v1.0.7.18 (GNU/Linux-x86_64)
                                                                                                         
* Origin: DragonsWeb Labs BBS 1:123/755 (1:123/755)

SOURCE: echomail via QWK@pharcyde.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.