nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
26.31k stars 7.69k forks source link

Defining single letters and not undoing that again is a recipe for trouble #1463

Closed ell1e closed 1 year ago

ell1e commented 1 year ago

Describe the bug stb_vorbis.c is meant to be included in larger surrounding files. It defines L, C, and R. Now any user code that follows will blow up if it uses single letter variables. I would suggest defining single letters and leaving them defined is bad practice.

To Reproduce Steps to reproduce the behavior:

  1. #include <stb/stb_vorbis.c>
  2. Use something like int L in your own code afterward

Expected behavior The include won't break use of single letter variables following later. However, it does.

Screenshots

nothings commented 1 year ago

stb_vorbis.c is not a header file, it is not meant to be included in larger surrounding files.

See #25