RTEMS Tools | misc/bin2c/rtems-bin2c.c: Add feature to include license header in generated C files (!58)

Harinder Singh Dhanoa (@hsd1807) gitlab at rtems.org
Wed Apr 2 10:41:32 UTC 2025




Harinder Singh Dhanoa commented on a discussion on misc/bin2c/rtems-bin2c.c: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/58#note_122001

 > +
 > +  if (fseek(file, 0, SEEK_SET) != 0) {
 > +    perror("error: could not seek to start of license file");
 > +    fclose(file);
 > +    exit(1);
 > +  }
 > +
 > +  buffer = malloc(length + 1);
 > +  if (!buffer) {
 > +    perror("error: could not allocate memory for license file");
 > +    fclose(file);
 > +    exit(1);
 > +  }
 > +
 > +  readsize = fread(buffer, 1, length, file);
 > +  if (readsize != length) {

okay, I casted the lengt, and I am just curious how testing is done at your side, like I checked this code by compiling it using the gcc command and I got no warnings, like this can help me test the code at my end and fix such warnings before pushing them.

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/tools/rtems-tools/-/merge_requests/58#note_122001
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20250402/45970d64/attachment.htm>


More information about the bugs mailing list