Sujet : Re: Which code style do you prefer the most?
De : 643-408-1753 (at) *nospam* kylheku.com (Kaz Kylheku)
Groupes : comp.lang.cDate : 28. Feb 2025, 19:39:29
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250228102759.265@kylheku.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : slrn/pre1.0.4-9 (Linux)
On 2025-02-28, candycanearter07 <
candycanearter07@candycanearter07.nomail.afraid> wrote:
David Brown <david.brown@hesbynett.no> wrote at 09:21 this Friday (GMT):
On 28/02/2025 05:29, Kaz Kylheku wrote:
On 2025-02-28, candycanearter07 <candycanearter07@candycanearter07.nomail.afraid> wrote:
David Brown <david.brown@hesbynett.no> wrote at 16:26 this Thursday (GMT):
lines, /that/ would be a bug.
>
The bug, of course, is using Windows and Windows-style paths :-)
>
What's worse, its a WONTFIX!
Not sure what you're talking about. All Microsoft operating systems
going back to MS-DOS have accepted the forward slash as an alternative
path separator. C:/Windows/System32 is a legitimate Windows-style path.
>
Yes, you can often use forward slashes for directory separations in
Windows - but you can't do so everywhere. There's no doubt that forward
slashes are the standard in the Windows world.
>
And, it's obviously the default for most paths.
There is no "default". The file system does not store any path separator
characters it's made of directory objects that point to other
direcory objects.
The Win32 functions like CreateFileEx allow path syntax to use either
kind of slash. Just like MS-DOS did.
If you're not able to use a forward slash on Windows, it's because some
program decided that it knows better and is refusing to pass down your
path to the actual operating system. Or else has some other bug, like a
"make all directory components" function (a la mkdir -p) or other path
manipulation which only breaks on backslashes.
Fun fact: on some old version of MS-DOS, you could configure COMMAND.COM
to use forward slashes. There was a user preference variable for it.
Some incorrectly-written user space programs might not like it.
>
Indeed - and that can be a pain.
>
However, you can certainly use forward slashes in things like #include
directives when using gcc on Windows, or in makefiles - and that covers
a lot of my needs for path names!
>
Probably because gcc isn't made by MS.
I seem to recall that you can use forward slashes just fine in #include
directives with Microsoft's C/C++ compiler, CL.EXE.
Look, back in 2017, someone in the Visual Studio development community
complained that autocomplete for #include was generating backslashes:
https://developercommunity.visualstudio.com/t/use-forward-slashes-by-default-for-includes/170016They accepted the issue and fixed it:
"Thank you for your feedback! We have fixed this issue and it’s
available in
https://www.visualstudio.com/vs/preview Thank you for
helping us build a better Visual Studio!"
-- TXR Programming Language: http://nongnu.org/txrCygnal: Cygwin Native Application Library: http://kylheku.com/cygnalMastodon: @Kazinator@mstdn.ca