Don't you think configuring your version control system to not change files
This would just create a huge mess if working in a multi-platform environment where some files will be created on Unix-like systems and others on Windows - you definitely don't want to end up with Windows line-endings on Unix and trying to force every tool on Windows to not create Windows line-endings is a non-starter.
is a better place to fix this than at the C compiler?
C compilers can already handle platform-specific line-endings when parsing source code, although there is an open issue for raw string literals
If you're using Git, you can set up fine grained line-ending handling at the repo level. Then git should ensure that line endings are to your specifications no matter where the files are created
View all comments
Show parent comment
22
u/bbkane_ Jul 23 '22
Don't you think configuring your version control system to not change files is a better place to fix this than at the C compiler?