Skip to content

Fix risk of Win32 timer setup call getting ignored - #1311

Merged
xuelix merged 1 commit into
FreeRTOS:mainfrom
kschwan:fix-win32-timer-setup-release-builds
Aug 15, 2025
Merged

xuelix merged 1 commit into
FreeRTOS:mainfrom
kschwan:fix-win32-timer-setup-release-builds

Conversation

@kschwan

@kschwan kschwan commented Aug 15, 2025

Copy link
Copy Markdown
Contributor

Description

If a user configures the configASSERT macro to expand to nothing, a call to the Win32 API SetWaitableTimer() doesn't get compiled.

This can happen if, for example, configASSERT set defined as assert (from assert.h) which expands to nothing when NDEBUG is set (common for "release" builds).

This PR has a patch to fix the issue.

Test Steps

Using the Win32 port, define configASSERT as follows:

#define configASSERT( x ) ( (void)0 )

then the scheduler doesn't "tick" and calls to, fx., vTaskDelay() won't return.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kschwan
kschwan marked this pull request as ready for review August 15, 2025 10:04
@kschwan
kschwan requested a review from a team as a code owner August 15, 2025 10:04
@kschwan

kschwan commented Aug 15, 2025

Copy link
Copy Markdown
Contributor Author

I'm not sure how to run tests - please let me know if I should do anything in that regard.

If a user configures the configASSERT macro to expand to nothing,
a call to the Win32 API SetWaitableTimer() doesn't get compiled.

This can happen if, for example, configASSERT(x) set defined as
assert(x) (from assert.h) which expands to nothing when NDEBUG is
set (common for "release" builds).
@kschwan
kschwan force-pushed the fix-win32-timer-setup-release-builds branch from 63fd5e9 to 2d7e22f Compare August 15, 2025 10:07
@sonarqubecloud

Copy link
Copy Markdown

@xuelix
xuelix merged commit ccabdec into FreeRTOS:main Aug 15, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants