Thread: Help me solve compiling warnings?

  1. #1
    Registered User
    Join Date
    Apr 2020
    Posts
    9

    Post Help me solve compiling warnings?

    Hello, i recently updated my WSL program and when compiling the same program i get a ton of warnings. like...


    track.c:309:21: note: ‘snprintf’ output between 26 and 4121 bytes into a destination of size 4096 309 |
    snprintf( buf, MAX_STRING_LENGTH, "Don't make me find you, %s!", victname );


    my main file has these settings:


    #define MAX_KEY_HASH 2048
    #define MAX_STRING_LENGTH 4096 /* buf */
    #define MAX_INPUT_LENGTH 1024 /* arg */
    #define MAX_INBUF_SIZE 1024
    #define MSL MAX_STRING_LENGTH
    #define MIL MAX_INPUT_LENGTH


    I tried rising the values but the problem persists.
    How i can fix it?
    Can anyone help?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Try making MAX_STRING_LENGTH at least 4121

    Or make your 'victname' array a more realistic shorter length.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 10
    Last Post: 08-11-2015, 04:16 PM
  2. How to solve warnings that appear when building my DLL...
    By starcatcher in forum Windows Programming
    Replies: 6
    Last Post: 12-14-2008, 11:47 AM
  3. for/while Warnings
    By reaperman in forum C++ Programming
    Replies: 3
    Last Post: 10-28-2008, 04:14 PM
  4. Warnings when compiling with command prompt (MSVC++)
    By knave in forum C++ Programming
    Replies: 6
    Last Post: 08-06-2003, 01:31 PM
  5. what do these warnings mean
    By Unregistered in forum C Programming
    Replies: 7
    Last Post: 02-08-2002, 04:23 PM

Tags for this Thread