FreeRTOS / FreeRTOS-Kernel

FreeRTOS kernel files only, submoduled into https://github.com/FreeRTOS/FreeRTOS and various other repos.
https://www.FreeRTOS.org
MIT License
2.51k stars 1.05k forks source link

Fix compilation warning about undelcared pthread_setname_np #1079

Closed maxiaogood closed 3 weeks ago

maxiaogood commented 1 month ago

Description

Use _GNU_SOURCE macro instead of __USE_GNU and define it before including portmacro.h. The reason is that portmacro.h includes limits.h which in-turn includes features.h - this results in __USE_GNU getting incorrectly undefined.

Test Steps

  1. use glibc2.24 and gcc 6.3.0 build sucess
  2. use glibc2.35 and gcc 11.3.0 build sucess

Checklist:

Related Issue

1077

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

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud