DaveGamble / cJSON

Ultralightweight JSON parser in ANSI C
MIT License
10.28k stars 3.15k forks source link

Fix optimization flag #850

Closed sbvoxel closed 1 month ago

sbvoxel commented 2 months ago

Found by ChatGPT 4

sbvoxel commented 2 months ago

I'm not making any judgement call on whether or not this flag is a good idea, but this was clearly the original intent. Alternatively the flag could be removed.

Alanscut commented 2 months ago
I'm not making any judgement call on whether or not this flag is a good idea, but this was clearly the original intent

+1

The -01 looks like a typo. -O1 is the default optimization level of GCC, while clang has a default value of -O0. This will be enabled when sanitizer was turned on. I'm not that familiar with sanitizer. Does the -O1 flag affect sanitizer?

Alanscut commented 1 month ago

The current misused flag -01 looks like a typo of -O1 and will not work. And I do not think the flag -O1 can do any help with sanitizer.

I prefer removing this flag to be more consistent with current behavior.