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

minor code improvements; check the log below #2

Open
kmilo17pet opened this issue Jun 19, 2020 · 0 comments
Open

minor code improvements; check the log below #2

kmilo17pet opened this issue Jun 19, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@kmilo17pet
Copy link
Contributor

gcc -Wall -flto -Wextra -Wimplicit-fallthrough=0 -Wformat-security -Wduplicated-cond -Wfloat-equal -Wshadow -Wconversion -Wsign-conversion -Wjump-misses-init -Wlogical-not-parentheses -Wnull-dereference -Wnull-dereference -Wstringop-overflow -fprofile-arcs -ftest-coverage -fstrict-aliasing -O2 -std=c89 -pedantic -D_POSIX_C_SOURCE=199309L -MD -Wstrict-aliasing -I. -I./src/Sigfox/ -I./src/main/ -I./src/test/ -c src/Sigfox/wssfm1xrx.c -o obj/src/Sigfox/wssfm1xrx.o
Compiling obj/src/Sigfox/wssfm1xrx.o [WARNING]
In file included from src/Sigfox/wssfm1xrx.c:19:0:
src/Sigfox/wssfm1xrx.h:177:16: warning: comma at end of enumerator list [-Wpedantic]
WSSFM1XRX_RCZ6,
^
src/Sigfox/wssfm1xrx.c: In function ‘WSSFM1XRX_AskChannels’:
src/Sigfox/wssfm1xrx.c:368:18: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
Channels->x = (uint8_t)obj->RxFrame[0]- (uint8_t)'0';/* ((rspPtr-1))-(uint8_t)'0';/ /non compliant misra c 18.4/
^
src/Sigfox/wssfm1xrx.c:369:18: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
Channels->y = (uint8_t)obj->RxFrame[2] -(uint8_t)'0' ; /* ((rspPtr+1))-(uint8_t)'0'; /
^
src/Sigfox/wssfm1xrx.c: In function ‘WSSFM1XRX_SendMessage’:
src/Sigfox/wssfm1xrx.c:505:17: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
uint8_t slen = ((uint8_t)2
size) + (uint8_t)6; /misra c 10.4 & 12.1/
^
src/Sigfox/wssfm1xrx.c: In function ‘DL_DiscriminateDownLink’:
src/Sigfox/wssfm1xrx.c:629:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
uint8_t i;
^~~~~~~
src/Sigfox/wssfm1xrx.c:635:16: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
byteIndex += (uint8_t)WSSFM1XRX_DL_BYTES_OFFSET;
^
src/Sigfox/wssfm1xrx.c: In function ‘WSSFM1XRX_BuildFrame’:
src/Sigfox/wssfm1xrx.c:677:14: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
finalsize = sizecopy
((uint8_t)2);
^~~~~~~~
src/Sigfox/wssfm1xrx.c:680:10: warning: conversion to ‘int8_t {aka signed char}’ from ‘int’ may alter its value [-Wconversion]
for(i = ((int8_t)sizecopy-1) ; i >= 0; i--){ /*misra 10.4 */
^
src/Sigfox/wssfm1xrx.c: In function ‘NibbletoX’:
src/Sigfox/wssfm1xrx.c:704:8: warning: conversion to ‘uint8_t {aka unsigned char}’ from ‘int’ may alter its value [-Wconversion]
c_h = (value & (uint8_t)0x0Fu) + (uint8_t)'0' ;
^
src/Sigfox/wssfm1xrx.c:706:36: warning: conversion to ‘char’ from ‘int’ may alter its value [-Wconversion]
return (ch > (char)'9')? (ch + 7) : ch;

@kmilo17pet kmilo17pet added the enhancement New feature or request label Jun 19, 2020
@kmilo17pet kmilo17pet assigned ghost Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant