Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang warnings in fat.c and file.c #1

Open
glennmatthews opened this issue Mar 3, 2015 · 0 comments
Open

clang warnings in fat.c and file.c #1

glennmatthews opened this issue Mar 3, 2015 · 0 comments

Comments

@glennmatthews
Copy link

clang -g -O2 -DVERSION="1.0.0-beta" -Wall -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-sign-conversion -c -o .o/backtrace.o backtrace.c
clang -g -O2 -DVERSION="1.0.0-beta" -Wall -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-sign-conversion -c -o .o/fat.o fat.c
fat.c:30:23: warning: unused variable 'FAT_FILE_VFAT_CHAR' [-Wunused-const-variable,24]
 static const uint32_t FAT_FILE_VFAT_CHAR            = 0x01;
                       ^
fat.c:35:23: warning: unused variable 'FAT_ATTR_IS_READ_ONLY' [-Wunused-const-variable,24]
 static const uint32_t FAT_ATTR_IS_READ_ONLY         = 0x01;
                       ^
fat.c:36:23: warning: unused variable 'FAT_ATTR_IS_HIDDEN' [-Wunused-const-variable,24]
 static const uint32_t FAT_ATTR_IS_HIDDEN            = 0x02;
                       ^
fat.c:37:23: warning: unused variable 'FAT_ATTR_IS_SYSTEM' [-Wunused-const-variable,24]
 static const uint32_t FAT_ATTR_IS_SYSTEM            = 0x04;
                       ^
fat.c:38:23: warning: unused variable 'FAT_ATTR_IS_LABEL' [-Wunused-const-variable,24]
 static const uint32_t FAT_ATTR_IS_LABEL             = 0x08;
                       ^
5 warnings generated.
clang -g -O2 -DVERSION="1.0.0-beta" -Wall -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-sign-conversion -c -o .o/command.o command.c
clang -g -O2 -DVERSION="1.0.0-beta" -Wall -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -Wno-trigraphs -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-sign-conversion -c -o .o/file.o file.c
file.c:413:29:{413:29-413:60}: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size,2]
                             sizeof(regexp) - strlen(regexp));
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
file.c:413:29: note: change the argument to be the free space in the destination buffer minus the terminating null byte [2]
                             sizeof(regexp) - strlen(regexp));
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             sizeof(regexp) - strlen(regexp) - 1
fix-it:"file.c":{413:29-413:60}:"sizeof(regexp) - strlen(regexp) - 1"
file.c:419:25:{419:25-419:56}: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size,2]
                         sizeof(regexp) - strlen(regexp));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
file.c:419:25: note: change the argument to be the free space in the destination buffer minus the terminating null byte [2]
                         sizeof(regexp) - strlen(regexp));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         sizeof(regexp) - strlen(regexp) - 1
fix-it:"file.c":{419:25-419:56}:"sizeof(regexp) - strlen(regexp) - 1"
file.c:424:25:{424:25-424:56}: warning: the value of the size argument in 'strncat' is too large, might lead to a buffer overflow [-Wstrncat-size,2]
                         sizeof(regexp) - strlen(regexp));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
file.c:424:25: note: change the argument to be the free space in the destination buffer minus the terminating null byte [2]
                         sizeof(regexp) - strlen(regexp));
                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         sizeof(regexp) - strlen(regexp) - 1
fix-it:"file.c":{424:25-424:56}:"sizeof(regexp) - strlen(regexp) - 1"
3 warnings generated.
glennmatthews added a commit to glennmatthews/fatdisk that referenced this issue Mar 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant