home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   LINUX      Torvalds farts & fans know what he ate      8,232 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 6,961 of 8,232   
   Andrew Alt to Maurice Kinal   
   rmw compile warnings   
   03 Mar 21 11:15:20   
   
   MSGID: 1:261/38.0 13f82519   
   REPLY: 1:153/7001 603d2a5f   
   TZUTC: -0500   
   CHARSET: LATIN-1   
   -=> Maurice Kinal wrote to Andrew Alt <=-   
      
    MK> -={ 2021-03-01 17:54:39.246915930+00:00 }=-   
      
    MK> Hey Andrew!   
      
    MK> The above was done on my custom pure 64-bit nondistribution rootfs (aka   
    MK> motorshed) using gcc-10.2.0/glibc-2.33 and friends.   
      
    MK> Does this help any?   
      
   Hi, Maurice!   
      
   On Debian with gcc 8 I wasn't getting any warnings. So.. that reminds me I   
   might have   
   to make some changes to get rid of those warnings. :) I'm not really sure of   
   the best   
   way to fix those though. I have mixed feelings about using snprintf(). I have   
   redundant checks in place to check string lengths before concatenating, and I   
   don't   
   want strings to just get truncated. rmw is designed to exit (without a   
   segfault) with   
   a message if a buffer overflow is attempted. I think I should just change all   
   my   
   snprintf() statements to sprintf()... Which probably won't fix the warnings you   
      
   mentioned, lol ;)   
      
      
   I can get even more if I use CFLAGS="-Wformat -Wstringop-truncation   
   -Wformat-overflow=2 -pedantic -Wextra -Wformat-truncation=2" :)   
      
   Any suggestions? Probably if don't set fixed lengths in the structures and   
   instead   
   use calloc() at the time when I concatenate and write the final string, that   
   would   
   get rid of some of these annoying messages I get when I use the flags mentioned   
      
   above. Seems like that would require a lot of extra manual memory management   
   though.   
   Things are working fine right now so I'm reluctant to change the code until I   
   really   
   understand well how best to fix those warnings.   
      
     CC       main.o   
   ../../rmw/src/main.c: In function â ÿremove_to_wasteâ Ö: ../../r   
   w/src/main.c:422:101: warning: â ÿ%sâ Ö directive output between 0 and 4096   
   bytes may exceed minimum required size of 4095 [-Wformat-truncation=]   
    tf (st_file_properties.waste_dest_name, sizeof   
   (st_file_properties.waste_dest_name), "%s%s",   
      
          ^~   
      
   ../../rmw/src/main.c:422:100: note: assuming directive output of 1 byte   
    tf (st_file_properties.waste_dest_name, sizeof   
   (st_file_properties.waste_dest_name), "%s%s",   
      
         ^~~~~~   
      
   ../../rmw/src/main.c:422:9: note: â ÿsnprintfâ Ö output 1 or more bytes   
   (assuming 4098) into a destination of size 4097   
            snprintf (st_file_properties.waste_dest_name, sizeof   
   (st_file_properties.waste_dest_name), "%s%s",   
      
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   ~~~~~~~~~~~~~~~~~~~   
                      waste_curr->files, st_file_properties.base_name);   
                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     CC       restore_rmw.o   
   ../../rmw/src/restore_rmw.c: In function â ÿrestoreâ Ö: ../../rm   
   /src/restore_rmw.c:72:47: warning: â ÿ%sâ Ö directive output between 0 and   
   4096 bytes may exceed minimum required size of 4095 [-Wformat-truncation=]   
        snprintf (file.info, sizeof (file.info), "%s%s%s%s", file.relative_path,   
   file.relative_info_path,   
                                                  ^~         ~~~~~~~~~~~~~~~~~~   
   ../../rmw/src/restore_rmw.c:72:46: note: assuming directive output of 1 byte   
        snprintf (file.info, sizeof (file.info), "%s%s%s%s", file.relative_path,   
   file.relative_info_path,   
                                                 ^~~~~~~~~~   
   ../../rmw/src/restore_rmw.c:72:5: note: â ÿsnprintfâ Ö output 11 or more bytes   
   (assuming 4116) into a destination of size 4097   
        snprintf (file.info, sizeof (file.info), "%s%s%s%s", file.relative_path,   
   file.relative_info_path,   
      
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   ~~~~~~~~~~~~~~~~~~   
                 file.base_name, TRASHINFO_EXT);   
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   ../../rmw/src/restore_rmw.c: In function â ÿrestore_selectâ Ö: .   
   /../rmw/src/restore_rmw.c:364:59: warning: â ÿ%sâ Ö directive output between 0   
   and 4096 bytes may exceed minimum required size of 4095 [-Wformat-truncation=]   
              snprintf (recover_file, sizeof (recover_file), "%s%s",   
   waste_curr->files, item_name (items[i]));   
                                                              ^~   
   ../../rmw/src/restore_rmw.c:364:58: note: assuming directive output of 1 byte   
              snprintf (recover_file, sizeof (recover_file), "%s%s",   
   waste_curr->files, item_name (items[i]));   
                                                             ^~~~~~   
   ../../rmw/src/restore_rmw.c:364:11: note: â ÿsnprintfâ Ö output 1 or more   
   bytes (assuming 4098) into a destination of size 4097   
              snprintf (recover_file, sizeof (recover_file), "%s%s",   
   waste_curr->files, item_name (items[i]));   
      
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   ~~~~~~~~~~~~~~~~   
   ../../rmw/src/restore_rmw.c:244:38: warning: â ÿ%sâ Ö directive output between   
   0 and 4096 bytes may exceed minimum required size of 4095 [-Wfor   
   at-truncation=]   
          snprintf (full_path, req_len, "%s%s", waste_curr->files, entry->d_name);   
                                         ^~   
     CC       config_rmw.o   
   ../../rmw/src/config_rmw.c: In function â ÿparse_line_wasteâ Ö:    
   ./../rmw/src/config_rmw.c:306:42: warning: â ÿ%sâ Ö directive output between 0   
   and 4096 bytes may exceed minimum required size of 4095 [-Wformat-truncation=]   
      snprintf (waste_curr->files, req_len, "%s%s", waste_curr->parent,   
   "/files/");   
                                             ^~   
   ../../rmw/src/config_rmw.c:324:41: warning: â ÿ%sâ Ö directive output between   
   0 and 4096 bytes may exceed minimum required size of 4095 [-Wfor   
   at-truncation=]   
      snprintf (waste_curr->info, req_len, "%s%s", waste_curr->parent, "/info/");   
                                            ^~   
     CC       parse_cli_options.o   
     CC       strings_rmw.o   
     CC       purging_rmw.o   
   ../../rmw/src/purging_rmw.c: In function â ÿpurgeâ Ö: ../../rmw/   
   rc/purging_rmw.c:332:18: warning: â ÿ%sâ Ö directive output between 0 and 4096   
   bytes may exceed minimum required size of 4095 [-Wformat-truncation=]   
                    "%s%s", waste_curr->info, st_trashinfo_dir_entry->d_name);   
                     ^~   
   ../../rmw/src/purging_rmw.c: In function â ÿorphan_maintâ Ö: ../   
   ./rmw/src/purging_rmw.c:562:46: warning: â ÿ%sâ Ö directive output between 0   
   and 4096 bytes may exceed minimum required size of 4095 [-Wformat-truncation=]   
          snprintf (path_to_trashinfo, req_len, "%s%s%s", waste_curr->info,   
                                                 ^~   
   ../../rmw/src/purging_rmw.c:562:45: note: assuming directive output of 1 byte   
          snprintf (path_to_trashinfo, req_len, "%s%s%s", waste_curr->info,   
                                                ^~~~~~~~   
   ../../rmw/src/purging_rmw.c:574:57: warning: â ÿ%sâ Ö directive output between   
   0 and 4096 bytes may exceed minimum required size of 4095 [-Wfor   
   at-truncation=]   
          snprintf (st_file_properties.real_path, req_len, "%s%s%s",   
                                                            ^~   
   ../../rmw/src/purging_rmw.c:574:56: note: assuming directive output of 1 byte   
          snprintf (st_file_properties.real_path, req_len, "%s%s%s",   
                                                           ^~~~~~~~   
     CC       messages_rmw.o   
     CC       time_rmw.o   
     CC       trashinfo_rmw.o   
   ../../rmw/src/trashinfo_rmw.c:31:36: warning: initializer element is not a   
   constant expression [-Wpedantic]   
    const int LEN_MAX_TRASHINFO_LINE = (PATH_MAX * 3 + strlen ("Path=") + 1);   
                                       ^   
   ../../rmw/src/trashinfo_rmw.c: In function â ÿcreate_trashinfoâ Ö:   
   ../../rmw/src/trashinfo_rmw.c:47:40: warning: â ÿ%sâ Ö directive output   
   between 0 and 4096 bytes may exceed minimum required size of 4095   
   [-Wformat-truncation=]   
      snprintf (final_info_dest, req_len, "%s%s", waste_curr->info,   
   st_f_props->base_name);   
                                           ^~   
   ../../rmw/src/trashinfo_rmw.c:47:39: note: assuming directive output of 1 byte   
      snprintf (final_info_dest, req_len, "%s%s", waste_curr->info,   
   st_f_props->base_name);   
                                          ^~~~~~   
     CC       utils_rmw.o   
   ../../rmw/src/utils_rmw.c: In function â ÿunescape_urlâ Ö: ../..   
   rmw/src/utils_rmw.c:317:35: warning: format â ÿ%hhxâ Ö expects argument of   
   type â ÿunsigned char *â Ö, but argument 3 has type â ÿchar *â Ö [-Wformat=]   
          sscanf (str + pos_str, "%2hhx", dest + pos_dest);   
                                  ~~~~^   ~~~~~~~~~~~~~~~   
                                  %2hhx   
   ../../rmw/src/utils_rmw.c: In function â ÿhuman_readable_sizeâ Ö:   
   ../../rmw/src/utils_rmw.c:143:44: warning: â ÿ Bâ Ö directive output may be   
   truncated writing 2 bytes into a region of size between 0 and 19   
   [-Wformat-truncation=]   
        snprintf (buffer, sizeof (buffer), "%ld B", (long) size);   
                                               ^~   
   ../../rmw/src/utils_rmw.c:143:5: note: â ÿsnprintfâ Ö output between 4 and 23   
   bytes into a destination of size 20   
        snprintf (buffer, sizeof (buffer), "%ld B", (long) size);   
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   ../../rmw/src/utils_rmw.c:140:44: warning: â ÿ.â Ö directive output may be   
   truncated writing 1 byte into a region of size between 0 and 19    
   -Wformat-truncation=]   
        snprintf (buffer, sizeof (buffer), "%ld.%d %ciB", (long) size,   
                                               ^   
   ../../rmw/src/utils_rmw.c:140:5: note: â ÿsnprintfâ Ö output between 8 and 37   
   bytes into a destination of size 20   
        snprintf (buffer, sizeof (buffer), "%ld.%d %ciB", (long) size,   
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
                  (remainder * 10) / 1024, prefix[power]);   
                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
     CC       bst.o   
     CCLD     ../rmw   
      
   --   
   -Andy   
      
      
   ... A few feathers short of a whole duck.   
   -+- MultiMail/Linux v0.52   
      
   --- BBBS/Li6 v4.10 Toy-5   
    * Origin: Prism bbs (1:261/38)   
   SEEN-BY: 1/123 15/0 16/101 19/36 20/4609 50/13 90/1 103/705 105/81   
   SEEN-BY: 106/127 201 116/18 120/331 340 123/131 140 124/5016 128/2   
   SEEN-BY: 129/305 153/105 135 141 757 802 6809 7001 7715 154/10 203/0   
   SEEN-BY: 218/700 221/0 1 6 222/2 226/30 227/114 702 229/101 424 426   
   SEEN-BY: 229/452 550 616 664 1016 1017 230/150 152 240/77 1120 5138   
   SEEN-BY: 240/5411 5824 5832 5853 249/206 317 400 250/1 261/38 100   
   SEEN-BY: 261/1466 266/512 267/67 155 275/100 280/464 5003 282/1038   
   SEEN-BY: 282/1056 288/100 291/100 111 292/854 8125 310/31 317/3 320/119   
   SEEN-BY: 320/219 322/757 335/364 340/400 341/66 342/17 200 396/45   
   SEEN-BY: 423/120 633/280 640/1321 712/848 770/1 801/161 189 2320/105   
   SEEN-BY: 2432/390 2452/250 2454/119 3634/12 4500/1 5020/400 545 715   
   SEEN-BY: 5020/1042 1477 4441 5025/3 5030/1957 2404 5037/7 5053/58   
   SEEN-BY: 5053/400 5066/18 5080/102 5095/20   
   PATH: 261/38 153/757 221/6 5020/545 280/464 240/5832 229/426   
      

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca