tostercx / GTAO_Booster_PoC

Do What The F*ck You Want To Public License
2.84k stars 180 forks source link

[boost.c] is ill-formed (no diagnosis required): The Standard reserves function names beginning with ‘str’ or ‘mem’ for possible future use. #36

Open ViralTaco opened 3 years ago

ViralTaco commented 3 years ago

Hi,

Issue:

https://github.com/tostercx/GTAO_Booster_PoC/blob/fd8eaa8661500995442a0fe079b02e740845afe9/boost.c#L33 The name strlen_cached is reserved by the standard.

cf: ISO/IEC 9899:201x

NB: Also reserved are… Well, there's a fat list, really. Here is the most useful link you'll ever get for fast reference to the C and C++ Standards and libraries: cppreference.com C Reserved Identifiers

Current Behavior:

Undefined. Any, or none.

Expected Behavior:

The behavior of an identical function given a valid, unreserved, name.

Proposed Solution:

Change the name of the function. eg: cached_strlen

mempler commented 2 years ago

If you read it again, it's called strlen_cacher and not strlen_cached

tostercx commented 2 years ago

Yeah, apparently anything starting with str followed by a lowercase letter is reserved for future use, so this would still apply. Had no idea,

mempler commented 2 years ago

Lets just simply call it Superduperwhoopsboopsnonstdcompliant_strlen_cacher 😄 Jokes aside, truly a good first issue.