Skip to main content
Associate
June 18, 2026
Question

BUG: Compiler Error OSWrappers.cpp TouchGFX

  • June 18, 2026
  • 2 replies
  • 55 views

In TouchGFX/target/generated/OSWrappers.cpp at row 38 & 39 the lines : 

static TX_SEMAPHORE frame_buffer_sem = { 0 };
static TX_QUEUE vsync_q = { 0 };

will produce a GCC compiler error when the compiler settings are set at -Werror. 

error: missing initializer for member 'TX_SEMAPHORE_STRUCT::tx_semaphore_name' [-Werror=missing-field-initializers]

Compiled with these relevant flags

arm-none-eabi-g++ "../TouchGFX/target/generated/OSWrappers.cpp" -mcpu=cortex-m7 -std=gnu++17 -g3 -ffunction-sections -fdata-sections -fno-exceptions -fno-rtti -fno-use-cxa-atexit -Wall -Wextra -Werror

 

 

2 replies

Associate
June 18, 2026

In other terms. Why is TouchGFX not compilable with -Werror flag enabled?

Lead III
June 18, 2026

Disable the warning.
Using ={0} zero-initializes the whole struct. It’s not a bug.

"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."
Associate
June 18, 2026

Yeh, and also add fno-unused-parameter and fno-xxx call it. The problem, you can't do that to check your own code properly. Which shouldn't be the case. 

Lead III
June 19, 2026

unused parameter is a bug in my opinion. They should either remove it or mark it as unused using (void) or

[[maybe_unused]].
"Kudo posts if you have the same problem and kudo replies if the solution works.Click ""Accept as Solution"" if a reply solved your problem. If no solution was posted please answer with your own."