On 18/01/2024 04:30, Kaz Kylheku wrote:
On 2024-01-18, bart <[email protected]> wrote:
You mean via layers like WSL or MSYS2 or CYGWIN? I don't really consider >>> that running on Windows.
What is it? To the left of Windows? Behind Windows? Under Windows?
It doesn't matter which one of these prepositions it is, because in this
situation being discussed all those programs are doing is providing an
environment for building something.
Let's consider an OS like Android, to avoid a made-up one. (Put aside
the likelihood that deep inside Android might be a Linux core. Think of
the glossy-looking consumer OS that everyone knows.)
Now, somebody brings out some piece of software that only builds under Android.
To build it under Linux, requires installing a vast virtual Android OS
to do that.
Would you consider that being able to build 'under Linux'?
On 18/01/2024 16:16, bart wrote:
Could you, in good faith, provide sources to that project and say it
builds 'under Linux, no problem'. Never mind the considerable
dependencies they would need and the significant likelihood of failure.
Dependencies are part of life with computers. A Windows installation without additional software gives you Minesweeper and Wordpad. How can
you possibly justify thinking that installing msys2 and mingw-64 for a compilation means you are "not building under Windows" while installing
MSVC means you /are/ "building under Windows"? The MSVC installation is
10 times the size of mingw-64.
On 06/01/2024 07:39, David Brown wrote:
On 05/01/2024 19:42, Kaz Kylheku wrote:
On 2024-01-05, Keith Thompson <[email protected]> wrote:
When you wrote "in Linux", I wondered if you were being imprecise, but >>>> in fact that code is in the Linux kernel.
That means the macros aren't directly available to normal C code, but
you can always copy their definitions (*if* you're using a compiler
that supports the __builtin_types_compatible_p extension).
You can always copy their definitions, if you're using a compiler
that doesn't arbitrarily define __GNUC__ without providing the
associated behaviors:
#ifdef __GNU__
// define array_size in the Linux kernel way
#else
#define arrray_size(x) (sizeof (x)/sizeof *(x))
#endif
If you regularly build the code with a compiler that provides GNU
extensions (like as part of your CI), you're covered, even if you're
going to production with something else.
I use C++ this way in C projects; I have some macro features that
provide extra checks under C++. I get the benefit even if I just
compile the code as C++ only once before every release.
That is a good tactic if your code needs to be used with compilers
that don't have such features for static checking (perhaps you are
releasing your source code, and can't influence the tools or settings
users use). In a way, you are using gcc (or C++) as a linter.
I've done this myself when the actual target compiler had little in
the way of static checking - I ran gcc in parallel, for a different
target (the generated output was ignored), but with lots of warning
flags that the real compiler did not support.
This is pretty much how in the past I have suggested people use Tiny C:
use it for very fast compilation turnaround. Use gcc from time to time
for better error checking, and for production builds for faster code.
Another is for situations where obtaining the small-footprint Tiny C
compiler is simpler, or where it can be bundled with your source code.
Yet another is when you have a compiler for another language that
targets C code. Since the program has already been verified, the C code should be correct. Then extensive static checking is not needed; you
just want a fast backend that doesn't take up 95% of the overall
compilation time.
Again, use gcc for a production version for some extra speed, but it is
not essential to have it.
This is a compiler you've dismissed as a toy.
AFAIK, if I wanted to supply a program to any Linux user, I can't just
supply a binary, since every Linux is a bit different and they run on
more different kinds of processor.
This is where MS Windows reigned supreme.
On 19/01/2024 10:07, David Brown wrote:
On 18/01/2024 21:21, bart wrote:
AFAIK, if I wanted to supply a program to any Linux user, I can't
just supply a binary, since every Linux is a bit different and they
run on more different kinds of processor.
As so often, "AFAIK" for you is not very far.
For almost all Linux users, for almost all their programs, they
download and install binaries - they don't compile from source.
Compiling from source as a common method of distributing programs fell
out of fashion some 20 or 30 years ago.
That's good news. So I can build an ELF binary on my WSL today, I can
email it to you and you can run it on the nearest Linux machine?
I assume it will only work if that machine happens to be x64 (as that's
what mine is)?
Or will it not work even then?
What are the rules? Do I have to make a version for every variant of
Linux and make it available in the 'apt-get' repository?
For developers or companies who don't want to distribute source, or
who want to provide the users the convenience of binaries but it's not
appropriate to include the programs in distros, it is normal to
provide only one or two binaries - an x86-64 binary, and sometimes
also an AArch64 binary if that is a likely target.
It can be more complicated if the software has to integrate tightly
with different aspects of the system, but that's usually not an issue
for most software.
This is where MS Windows reigned supreme.
You mean it is so much more limited?
In being able to run EXEs created by anyone on any machine, and being
able to run them on any Windows computer, even years later.
(I think you can still run 32-bit EXEs compiled in the 1990s today.
16-bit EXEs can still run today on a 32-bit Windows.)
On 18/01/2024 21:21, bart wrote:
AFAIK, if I wanted to supply a program to any Linux user, I can't just
supply a binary, since every Linux is a bit different and they run on
more different kinds of processor.
As so often, "AFAIK" for you is not very far.
For almost all Linux users, for almost all their programs, they download
and install binaries - they don't compile from source. Compiling from source as a common method of distributing programs fell out of fashion
some 20 or 30 years ago.
For developers or companies who don't want to distribute source, or who
want to provide the users the convenience of binaries but it's not appropriate to include the programs in distros, it is normal to provide
only one or two binaries - an x86-64 binary, and sometimes also an
AArch64 binary if that is a likely target.
It can be more complicated if the software has to integrate tightly with different aspects of the system, but that's usually not an issue for
most software.
This is where MS Windows reigned supreme.
You mean it is so much more limited?
On 19/01/2024 12:17, bart wrote:
It
doesn't matter what anyone says, you will always twist things to fit
your preconceived ideas that everything Linux-related is terrible in
every way,
and that somehow you think it all proves that your own tools
are brilliant and the rest of the world is wrong.
On 19/01/2024 14:18, bart wrote:
It is also incomprehensible how someone can rant endlessly about "simplification" and "easy of use" when their claimed solution is to
make non-standard limited duplications of the functionality already
found on other machines.
On 19/01/2024 11:41, David Brown wrote:
On 19/01/2024 12:17, bart wrote:
It doesn't matter what anyone says, you will always twist things to
fit your preconceived ideas that everything Linux-related is terrible
in every way,
That's funny. I find that Linux people always have terrible things to
say about software development using Windows, usually totally unjustified.
The main reason is that on Linux they are reliant on a huge mountain of dependencies that don't exist on Windows, even when creating supposedly cross-platform products.
On 19/01/2024 10:07, David Brown wrote:
On 18/01/2024 21:21, bart wrote:
AFAIK, if I wanted to supply a program to any Linux user, I can't just
supply a binary, since every Linux is a bit different and they run on
more different kinds of processor.
As so often, "AFAIK" for you is not very far.
For almost all Linux users, for almost all their programs, they download
and install binaries - they don't compile from source. Compiling from
source as a common method of distributing programs fell out of fashion
some 20 or 30 years ago.
That's good news. So I can build an ELF binary on my WSL today, I can
email it to you and you can run it on the nearest Linux machine?
On 19/01/2024 14:18, bart wrote:
On 19/01/2024 11:41, David Brown wrote:
On 19/01/2024 12:17, bart wrote:
It doesn't matter what anyone says, you will always twist things to
fit your preconceived ideas that everything Linux-related is terrible
in every way,
That's funny. I find that Linux people always have terrible things to
say about software development using Windows, usually totally
unjustified.
And feel free to ignore these if you have good reason to believe they
are not fact based. Don't feel free to exaggerate what people say (I
say Linux is better for most development and programming work, other
than when targeting Windows itself - but you /can/ use Windows for many tasks, and I do use Windows as well as Linux). [...]
[...]
[...]
I can fully understand how someone who is only familiar with Windows
(and DOS before it) doesn't know about these utilities or where to get
them, and finds them strange at first. [...]
On 19/01/2024 14:42, David Brown wrote:
On 19/01/2024 14:18, bart wrote:
It is also incomprehensible how someone can rant endlessly about
"simplification" and "easy of use" when their claimed solution is to
make non-standard limited duplications of the functionality already
found on other machines.
The programs I write ARE easy to build, using ONLY a compiler.
You don't want to accept that, you'd rather it involved those mountains
of stuff.
On 19.01.2024 15:42, David Brown wrote:
On 19/01/2024 14:18, bart wrote:
On 19/01/2024 11:41, David Brown wrote:
On 19/01/2024 12:17, bart wrote:
It doesn't matter what anyone says, you will always twist things to
fit your preconceived ideas that everything Linux-related is terrible
in every way,
That's funny. I find that Linux people always have terrible things to
say about software development using Windows, usually totally
unjustified.
And feel free to ignore these if you have good reason to believe they
are not fact based. Don't feel free to exaggerate what people say (I
say Linux is better for most development and programming work, other
than when targeting Windows itself - but you /can/ use Windows for many
tasks, and I do use Windows as well as Linux). [...]
There was a time when I dual booted (pre-installed) WinDOS and
Linux. At some point I got aware that it makes no sense, Windows
was - besides its inherent issues - also completely unnecessary
(as could be seen soon); further installs were Linux-only.
It's a phenomenon that the marketing division of MS did so great
a job to mentally bind such a huge community. (There were other
reasons as well (driver support of companies, pre-installed OS
on hardware, gaming focus, or self-enforcing dissemination
feedback processes), but discussion would lead too far here.)
I've often observed uninformed WinDozers just spread uninformed
nonsense. But never in such extreme stubbornness as in this thread.
[...]
[...]
I can fully understand how someone who is only familiar with Windows
(and DOS before it) doesn't know about these utilities or where to get
them, and finds them strange at first. [...]
This is part of the phenomenon.
And as we see nothing helps if folks grew up and didn't leave
that bubble, didn't even dare to have a look outside and try
to grasp what's going on. Yet continuing uninformed rants about
something they never experienced nor understood to a minimum
extent.
We have to accept though that the condition where someone is
making specialized niche-software for a specific platform is
also not fostering susceptive open-mindedness when confronted
with the huge professional IT world.
But I have hope; after issues with Windows
I installed Linux
even for my (very old) father, and he has no problems with it
(using browser, email, and a text processor). And my children
installed Linux by themselves, anyway, and they're programming
their academic research tasks on that platform. - No lengthy
stupid discussions as in this thread.
On 19/01/2024 16:03, bart wrote:
On 19/01/2024 14:42, David Brown wrote:
On 19/01/2024 14:18, bart wrote:
It is also incomprehensible how someone can rant endlessly about
"simplification" and "easy of use" when their claimed solution is to
make non-standard limited duplications of the functionality already
found on other machines.
The programs I write ARE easy to build, using ONLY a compiler.
You don't want to accept that, you'd rather it involved those
mountains of stuff.
/Please/ stop making stupid, exaggerated and incorrect claims about what other people want or think.
I don't give a *beep* how easy or hard your programs are to compile -
they are utterly irrelevant to me. I don't have reason to believe they
are very relevant to anyone else either. But even if they were useful
to me, or at least of interest to me, it does not matter to me if they
need a whole range of standard utilities to build - because every system
I have, or ever have had, has the standard utilities.
Why is it so difficult for you to understand the concept of not caring?
It is absurd to suggest I /want/ your programs to need "make" or other utilities to compile - I *do* *not* *care* if it needs them or not.
There is no advantage or disadvantage to me if it uses make, sed, awk,
bash, date. There is no advantage or disadvantage to me if it does not
need them either. It is irrelevant.
It /would/ be an inconvenience to me if it required some obscure and
rarely used compiler like your own tools. TCC is also pretty obscure,
but Debian has it in it's repositories. Needing an invasive tool that screws up your system, like MSVC, would also be a pain, as would
anything that required very specific versions of tools. But that would
only matter if your programs were of interest.
And of course I accept that /you/ think it is important that you don't
use tools that everyone else finds convenient and useful. I don't understand your reasons for that
- it seems to be based on a determined
battle to ensure that you fail to get anything you deem to be "Linux
related" to work, combined with a fanaticism about "simple" that
completely misses the point. But I don't think anyone here doubts that /you/ think this is all desperately important, even though pretty much
no one else cares.
And /please/ stop making an arse of yourself here by calling a dozen
standard utilities "mountains of stuff".
On 19/01/2024 17:12, David Brown wrote:
On 19/01/2024 16:03, bart wrote:
On 19/01/2024 14:42, David Brown wrote:
On 19/01/2024 14:18, bart wrote:
It is also incomprehensible how someone can rant endlessly about
"simplification" and "easy of use" when their claimed solution is to
make non-standard limited duplications of the functionality already
found on other machines.
The programs I write ARE easy to build, using ONLY a compiler.
You don't want to accept that, you'd rather it involved those
mountains of stuff.
/Please/ stop making stupid, exaggerated and incorrect claims about what
other people want or think.
I don't give a *beep* how easy or hard your programs are to compile -
they are utterly irrelevant to me. I don't have reason to believe they
are very relevant to anyone else either. But even if they were useful
to me, or at least of interest to me, it does not matter to me if they
need a whole range of standard utilities to build - because every system
I have, or ever have had, has the standard utilities.
Why is it so difficult for you to understand the concept of not caring?
It is absurd to suggest I /want/ your programs to need "make" or other
utilities to compile - I *do* *not* *care* if it needs them or not.
There is no advantage or disadvantage to me if it uses make, sed, awk,
bash, date. There is no advantage or disadvantage to me if it does not
need them either. It is irrelevant.
It /would/ be an inconvenience to me if it required some obscure and
rarely used compiler like your own tools. TCC is also pretty obscure,
but Debian has it in it's repositories. Needing an invasive tool that
screws up your system, like MSVC, would also be a pain, as would
anything that required very specific versions of tools. But that would
only matter if your programs were of interest.
And of course I accept that /you/ think it is important that you don't
use tools that everyone else finds convenient and useful. I don't
understand your reasons for that
Because they don't work. Things like makefiles, even designed to work on >Windows, had a 50% failure rate.
On 19/01/2024 16:32, Janis Papanagnou wrote:
And as we see nothing helps if folks grew up and didn't leave
that bubble, didn't even dare to have a look outside and try
to grasp what's going on. Yet continuing uninformed rants about
something they never experienced nor understood to a minimum
extent.
It's not me who's in the bubble. How about that giant bubble called
'Linux'?
On 19/01/2024 17:12, David Brown wrote:
And of course I accept that /you/ think it is important that you don't
use tools that everyone else finds convenient and useful. I don't
understand your reasons for that
Because they don't work. Things like makefiles, even designed to work on Windows, had a 50% failure rate.
Apparently it is inconceivable to you to have an application written in
C say, that can be compiled either on Linux or Windows using only a C compiler.
But I will leave this alone now.
[...] Just including <unistd.h> has undefined behavior as far as
ISO C is concerned, [...]
On 2024-01-17, bart <[email protected]> wrote:
The only reason to use the shell for larger coding tasks that go
beyonod process control is that is that it's the only language you can
rely on being installed.
Keith Thompson <[email protected]> writes:
[...] Just including <unistd.h> has undefined behavior as far as
ISO C is concerned, [...]
Not true. The behavior of #include <unistd.h> is defined in
section 6.10.2 p2. One of two things is true: either the header
named is part of the implementation, or it isn't. If the named
header is part of the implementation, then it constitutes a
language extension, and so it must be documented (and defined).
On 2024-01-20, Tim Rentsch <[email protected]> wrote:...
named is part of the implementation, or it isn't. If the named
header is part of the implementation, then it constitutes a
language extension, and so it must be documented (and defined).
The problem with this reasoning is
1. Implementations in fact have internal headers that are not
documented, and which are not supposed to be included directly. You
will not get documentation for every single header that
is accessible via #include, and it is not reasonable for ISO C to
require it. I don't see where it does.
On 2024-01-20 21:50, James Kuyper wrote:The standard doesn't provide a definition for "extension", though it
"An implementation shall be accompanied by a document that defines allThat sentence says something subtly different from something like
implementation-defined and locale-specific characteristics and all
extensions." 4p9
"an implementation shall document everything that looks stable enough
to be an extension".
It is saying that there is required to be a document, and that in
that document there may be a list of one or more extensions.
The standard is defining the *fact* that this list is exhaustive:
it comprises all the extensions that are offered in the contract
between implementor and programmer.
Thus, for instance, if programmers empirically discover a behavior
which is not defined by ISO C, and which is not in that list,
it is not an extension. The standard states that that list has
all the extensions, and that discovered feature is not on it.
The sentence does not require implementors to document,
as an extension, every header file that is reachable by an #include directive.
However, it seems more reasonable to me that whether or not something is
an extension is not supposed to be up to the implementor to decide.
Instead, anything that is an extension must be listed. This would be an easier interpretation to defend if there were any explicit definition of "extension" in the standard.
Tim Rentsch <[email protected]> writes:
Keith Thompson <[email protected]> writes:
Tim Rentsch <[email protected]> writes:
Janis Papanagnou <[email protected]> writes:
This is a CPP question that arose last month. It's not about an
actual issue with the software, just out of curiosity and to be sure >>>>> it works reliable (it seemingly does).
In a C99 program on Linux (Ubuntu) I intended to use usleep() and
then also strnlen().
When I added usleep() and its include file I got an error and was
asked to define the CPP tag '_BSD_SOURCE'. I did so, and because I
wanted side effects of that tag kept as small as possible I
prepended it just before the respective #include and put it at the
end of my #include list
...other #includes...
#define _BSD_SOURCE
#include <unistd.h>
But as got obvious *that* way there had been side-effects and I
had to put the tag at the beginning of all include files (which
astonished me)
#define _BSD_SOURCE
#include <unistd.h>
...other #includes here...
For the strnlen() function I needed another CPP tag, '_GNU_SOURCE'.
So now I have both CPP tag definitions before the includes
I second the recommendations of Lowell Gilbert and others not to
define _BSD_SOURCE or _GNU_SOURCE (especially not _GNU_SOURCE)
but instead seek alternatives, which are readily available for
the two functionalities being sought in this case.
#define _GNU_SOURCE /* necessary for strnlen() in string.h */
#define _BSD_SOURCE /* necessary for usleep() in unistd.h */
...all #includes here...
For strnlen(), put an inline definition in a header file:
#ifndef HAVE_strnlen_dot_h_header
#define HAVE_strnlen_dot_h_header
#include <stddef.h>
static inline size_t
strnlen( const char *s, size_t n ){
extern void *memchr( const void *, int, size_t );
const char *p = memchr( s, 0, n );
return p ? (size_t){ p-s } : n;
}
#include <string.h>
#endif
Disclaimer: this code has been compiled but not tested.
strnlen() is specified by POSIX. It might make sense to
re-implement it if your code needs to work on a non-POSIX system
(that doesn't also provide it). Why would you want to do so
otherwise?
I'm trying to provide a helpful answer to the person I was
responding to, not espouse a philosophical viewpoint. Why do you
feel the need to start a style debate?
I don't. I simply asked you a question. You've refused to answer
it, and I won't waste my time asking again.
memchr() is declared in <string.h>. Why would you duplicate its
declaration rather than just using `#include <string.h>`?
I had a specific reason for writing the code the way I did.
It wasn't important to explain that so I didn't.
Unsurprisingly, you refuse to do so even when asked directly.
For usleep(), define an alternate function usnooze(), to be used
in place of usleep(). In header file usnooze.h:
[snip]
If your code doesn't need to be portable to systems that don't
provide usleep(), you can just use usleep(). If it does, its
probably better to modify the code so it uses nanosleep().
Not everyone agrees with that opinion. Again, I'm just trying to
provide an answer helpful to OP, not advance an agenda. Like I
said in the part of my posting that you left out, I don't want to
get involved in a style war. If OP wants to modify his code to
use nanosleep(), I'm fine with that. If want wants to keep using
usleep() or switch to using usnooze(), I'm fine with that too. I
think it's more important in this case to provide options than to
try to change someone's point of view.
As usual, you vaguely denigrate my opinion without sharing your own.
On 2024-01-21, James Kuyper <[email protected]> wrote:
However, it seems more reasonable to me that whether or not something is
an extension is not supposed to be up to the implementor to decide.
Instead, anything that is an extension must be listed. This would be an
easier interpretation to defend if there were any explicit definition of
"extension" in the standard.
The implication is that anything that works by accident must be listed
as an extension. If function arguments happen to be evaluated left to
right, with all side effects complete between them, this has to be
listed as an extension. Then in the future when the vendor finds that inconvenient for further compiler work, they have to take away the
extension.
On 1/21/24 12:55, Kaz Kylheku wrote:
On 2024-01-21, James Kuyper <[email protected]> wrote:
However, it seems more reasonable to me that whether or not
something is an extension is not supposed to be up to the
implementor to decide. Instead, anything that is an extension
must be listed. This would be an easier interpretation to defend
if there were any explicit definition of "extension" in the
standard.
The implication is that anything that works by accident must be
listed as an extension. If function arguments happen to be
evaluated left to right, with all side effects complete between
them, this has to be listed as an extension. Then in the future
when the vendor finds that inconvenient for further compiler work,
they have to take away the extension.
No, that's unspecified behavior, if 4p9 were intended to be
understood as mandating documentation of all unspecified behavior,
it would make the category of implementation-defined behavior
redundant.
Since extensions are also explicitly prohibited from changing the
behavior of strictly conforming code, I think that in order for
something qualify as an extension, it has to define behavior that
the standard leaves undefined.
In a certain sense, every
implementation implicitly defines that behavior - whatever it is
that actually happens when the behavior is undefined is that
definition. However, I think an extension should have to be
explicitly activated by some deliberate user choice, such as a
compiler option or by defining the behavior of some kinds of
syntax not allowed by the C standard. That's just IMHO, of course
- in the absence of a explicit definition in the standard, it's
hard to be sure what the committee intended.
On 2024-01-21, James Kuyper <[email protected]> wrote:
However, it seems more reasonable to me that whether or not something is
an extension is not supposed to be up to the implementor to decide.
Instead, anything that is an extension must be listed. This would be an
easier interpretation to defend if there were any explicit definition of
"extension" in the standard.
The implication is that anything that works by accident must be
listed as an extension. If function arguments happen to be
evaluated left to right, with all side effects complete between
them, this has to be listed as an extension. Then in the future
when the vendor finds that inconvenient for further compiler work,
they have to take away the extension.
I don't see how it can not be the implementor's privilege to
assert what is reliable for use and documented, versus what is
not.
Tim Rentsch <[email protected]> writes:
Kaz Kylheku <[email protected]> writes:
It's important to understand what constitutes an extension. And
there are different kinds of extensions.
If an implementation chooses, say, to evaluate function arguments
always left-to-right, that is perfectly okay (and need not be an
extension). But if an there is to be a /guarantee/ that function
arguments will always be evaluated left-to-right, that means
providing a guarantee that the C standard does not; thus we have an
extension (to the requirements in the C standard), and the extension
must be documented. This case is one kind of extension.
If an implementation chooses to guarantee left-to-right evaluation, I
don't see anything in the standard that requires that guarantee to be documented. (Of course it can and should be.)
On 2024-01-20, Tim Rentsch <[email protected]> wrote:
Keith Thompson <[email protected]> writes:
[...] Just including <unistd.h> has undefined behavior as far as
ISO C is concerned, [...]
Not true. The behavior of #include <unistd.h> is defined in
section 6.10.2 p2. One of two things is true: either the header
named is part of the implementation, or it isn't. If the named
header is part of the implementation, then it constitutes a
language extension, and so it must be documented (and defined).
The problem with this reasoning is
1. Implementations in fact have internal headers that are not
documented, and which are not supposed to be included directly.
You will not get documentation for every single header that
is accessible via #include, and it is not reasonable for ISO C to
require it. I don't see where it does.
2. A documented extension continues to be undefined behavior.
The behavior is "defined", but not "ISO C defined". So even
if all the implementation's internal headers were documented
as extensions, their use would still be UB.
Undefined behavior is for which "this document imposes not
requirements", right?
It is not behavior for which "this document, together with the
ocumentation accompanying a given implementation, imposes
no requirements". Just "this document" (and no other).
If "this document" imposes no requirements, it's "undefined
behavior", no matter who or what imposes additional requirements!
Intuitively, a header which is part of an implementation can do
anything. For instance #include <pascal.h> can cause the rest of
the translation unit to be analyzed as Pascal syntax, and not C.
An implementation can provide a header <reboot.h>, including
which causes a reboot at compile time, link time, or
execution time.
If such headers happen to exist, what in the standard is violated?
I used to experience a lot of push-back against the above views,
but I'm seeing that people are coming around.
On 2024-01-18, bart <[email protected]> wrote:
All I know about PowerShell is that instead of typing 'prog' to run the 'prog.exe' you've just created, you have to do '.\prog' just like you
have to do './prog' in Linux.
I don't know anything about PowerShell. In the case of the POSIX-like
shells, this is just a consequence of the . directory not being listed
in the PATH variable, which is an end-user configuration matter.
If you care about the convenience of just typing "prog", more than
about the security aspect, you can just add . to your PATH.
On Thu, 18 Jan 2024 19:40:44 -0000 (UTC), Kaz Kylheku ><[email protected]> wrote:
On 2024-01-18, bart <[email protected]> wrote:
That's not true for 'prog', but is true for any name of a PS cmdlet orAll I know about PowerShell is that instead of typing 'prog' to run the
'prog.exe' you've just created, you have to do '.\prog' just like you
have to do './prog' in Linux.
alias. In that case you must use a pathname (which can be EITHER
.\name OR ./name) OR name.exe.
Tim Rentsch <[email protected]> writes:
Kaz Kylheku <[email protected]> writes:
It's important to understand what constitutes an extension. And
there are different kinds of extensions.
If an implementation chooses, say, to evaluate function arguments
always left-to-right, that is perfectly okay (and need not be an
extension). But if an there is to be a /guarantee/ that function
arguments will always be evaluated left-to-right, that means
providing a guarantee that the C standard does not; thus we have an
extension (to the requirements in the C standard), and the extension
must be documented. This case is one kind of extension.
If an implementation chooses to guarantee left-to-right evaluation, I
don't see anything in the standard that requires that guarantee to be documented. (Of course it can and should be.)
It's not entirely clear to me exactly what must or must not be
considered to be an "extension" as the C standard uses the term. The standard doesn't show the word "extension" in italics or provide a
definition in section 3.
Unless your point is that it's not a guarantee unless it's documented?
But I don't see that that documentation is required *by the standard*.
[...]
If an implementation chooses to define, for example, __uint128_t to
be the name of an integer type, that represents a third kind of
extension. (Annex J.5 also mentions such definitions as an example
on its list of "Common extensions".) Such cases must be documented
as extensions because, one, the expected default is that there be no
definition (which normally would cause a diagnostic because of some
constraint violation), and two, only the implementation is in a
position to know if the symbol in question was defined by the
implementation or by something else. Clearly any definition the
implementation provides signals a change from the expected default,
which by any reasonable definition of the word constitutes an
extension, and hence must be documented.
Again, that can and should be documented, but since any use of the
identifer __uint128_t has undefined behavior,
I don't see any
requirement in the standard that it must be documented.
(Aside: gcc has an extension adding __int128 as a keyword, supporting
types "__int128" and "unsigned __int128", but only on some target
systems. These do not qualify as extended integer types. I understand
that "__uint128_t" was a hypothetical example.)
Janis Papanagnou <[email protected]> wrote:
On 16.01.2024 19:03, David Brown wrote:
[...], because they know that Norwegians are superior to Swedes in
every way...
I just wanted to reply on that but then I saw your email address... :-)
A Finn smirking from the sidelines.
/* Mail: Mechelininkatu 26 B 27, FI-00100 Helsinki */
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 01:39:25 |
| Calls: | 12,098 |
| Calls today: | 6 |
| Files: | 15,003 |
| Messages: | 6,517,865 |