Bird
0
0

Why does this code fail to compile?

medium📝 Troubleshoot Q7 of 15
FreeRTOS - Debugging and Monitoring

Why does this code fail to compile?

UBaseType_t waterMark = uxTaskGetStackHighWaterMark(1234);

AFunction does not accept parameters
BMissing semicolon at end of line
CUBaseType_t is undefined
DInvalid task handle type; should be TaskHandle_t or NULL
Step-by-Step Solution
Solution:
  1. Step 1: Check parameter type

    uxTaskGetStackHighWaterMark expects a TaskHandle_t or NULL, not an integer literal.
  2. Step 2: Confirm syntax correctness

    Semicolon is present; UBaseType_t is defined; function accepts parameters.
  3. Final Answer:

    Invalid task handle type; should be TaskHandle_t or NULL -> Option D
  4. Quick Check:

    Task handle must be correct type [OK]
Quick Trick: Task handles are pointers or NULL, not integers [OK]
Common Mistakes:
  • Passing raw integers as task handles
  • Ignoring type definitions
  • Assuming function takes no parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes