Skip to content

Commit

Permalink
misc: fix gcc compiler warnings
Browse files Browse the repository at this point in the history
undefined variables, strict prototypes
  • Loading branch information
elagil committed Nov 9, 2023
1 parent d0c8bb7 commit 64f9250
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/gdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "rtt.h"
#endif

#if ADVERTISE_NOACKMODE == 1
#if defined(ADVERTISE_NOACKMODE) && ADVERTISE_NOACKMODE == 1
/*
* This lets GDB know that the probe supports ‘QStartNoAckMode’
* and prefers to operate in no-acknowledgment mode
Expand Down
2 changes: 1 addition & 1 deletion src/include/gdb_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ extern target_s *cur_target;
void gdb_poll_target(void);
void gdb_main(char *pbuf, size_t pbuf_size, size_t size);
int gdb_main_loop(target_controller_s *tc, char *pbuf, size_t pbuf_size, size_t size, bool in_syscall);
char *gdb_packet_buffer();
char *gdb_packet_buffer(void);

#endif /* INCLUDE_GDB_MAIN_H */
4 changes: 2 additions & 2 deletions src/include/rtt_if.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ int rtt_if_exit(void);
/* target to host: write len bytes from the buffer starting at buf. return number bytes written */
uint32_t rtt_write(const char *buf, uint32_t len);
/* host to target: read one character, non-blocking. return character, -1 if no character */
int32_t rtt_getchar();
int32_t rtt_getchar(void);
/* host to target: true if no characters available for reading */
bool rtt_nodata();
bool rtt_nodata(void);

#endif /* INCLUDE_RTT_IF_H */
2 changes: 1 addition & 1 deletion src/target/adiv5.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static uint32_t cortexm_initial_halt(adiv5_access_port_s *ap)
*/
static bool cortexm_prepare(adiv5_access_port_s *ap)
{
#if PC_HOSTED == 1 || ENABLE_DEBUG == 1
#if (defined(PC_HOSTED) && PC_HOSTED == 1) || (defined(ENABLE_DEBUG) && ENABLE_DEBUG == 1)
uint32_t start_time = platform_time_ms();
#endif
uint32_t dhcsr = cortexm_initial_halt(ap);
Expand Down
6 changes: 3 additions & 3 deletions src/target/adiv5_swd.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

/*
/*
* This file implements the SWD specific functions of the
* ARM Debug Interface v5 Architecture Specification, ARM doc IHI0031A.
*/
Expand Down Expand Up @@ -67,7 +67,7 @@ static void swd_line_reset_sequence(const bool idle_cycles)
}

/* Switch out of dormant state into SWD */
static void dormant_to_swd_sequence()
static void dormant_to_swd_sequence(void)
{
/*
* ARM Debug Interface Architecture Specification, ADIv5.0 to ADIv5.2. ARM IHI 0031C
Expand Down Expand Up @@ -102,7 +102,7 @@ static void dormant_to_swd_sequence()
}

/* Deprecated JTAG-to-SWD select sequence */
static void jtag_to_swd_sequence()
static void jtag_to_swd_sequence(void)
{
/*
* ARM Debug Interface Architecture Specification, ADIv5.0 to ADIv5.2. ARM IHI 0031C
Expand Down
2 changes: 1 addition & 1 deletion src/target/jtag_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static bool jtag_read_idcodes(void)

static void jtag_display_idcodes(void)
{
#if ENABLE_DEBUG
#if defined(ENABLE_DEBUG) && ENABLE_DEBUG
for (size_t device = 0; device < jtag_dev_count; ++device) {
const char *description = "Unknown";
for (size_t idx = 0; dev_descr[idx].idcode; ++idx) {
Expand Down
2 changes: 1 addition & 1 deletion src/target/sfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

static inline void sfdp_debug_print(const uint32_t address, const void *const buffer, const uint32_t length)
{
#if ENABLE_DEBUG
#if defined(ENABLE_DEBUG) && ENABLE_DEBUG == 1
DEBUG_INFO("%" PRIu32 " byte SFDP read at 0x%" PRIx32 ":\n", length, address);
const uint8_t *const data = buffer;
for (size_t i = 0; i < length; i += 8U) {
Expand Down

0 comments on commit 64f9250

Please sign in to comment.