Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

Build with -Wswitch-default, and address warnings #55

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ message ( "Build type: ${CMAKE_BUILD_TYPE}" )
if ( CMAKE_C_COMPILER_ID STREQUAL "GNU" OR
CMAKE_C_COMPILER_ID MATCHES "Clang" )
message ( STATUS "adding GCC/Clang options ")
add_definitions ( -std=gnu99 -Wall -Wextra -pedantic )
add_definitions ( -std=gnu99 -Wall -Wextra -pedantic -Wswitch-default )
if ( fatal_warnings )
add_definitions ( -Werror )
endif ()
Expand Down
4 changes: 4 additions & 0 deletions src/cn-cbor.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ static cn_cbor *decode_item (struct parse_buf *pb CBOR_CONTEXT, cn_cbor* top_par
} else {
CN_CBOR_FAIL(CN_CBOR_ERR_MT_UNDEF_FOR_INDEF);
}
default:
break;
}
// process content
switch (mt) {
Expand Down Expand Up @@ -222,6 +224,8 @@ static cn_cbor *decode_item (struct parse_buf *pb CBOR_CONTEXT, cn_cbor* top_par
break;
default: cb->v.uint = val;
}
default:
break;
}
fill: /* emulate loops */
if (parent->flags & CN_CBOR_FL_INDEF) {
Expand Down
2 changes: 2 additions & 0 deletions src/cn-encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ void _encoder_visitor(const cn_cbor *cb, int depth, void *context)
case CN_CBOR_INVALID:
ws->offset = -1;
break;
default:
break;
}
}

Expand Down