determine operating system

T

Thomas Matthews

Joe said:
it is portable...

I tried this on VRTX operating system. No such command.
I tried this on MSDOS operating system. No such command.
I tried this on VAX operating system. No such command.
I tried this on our custom OS for an embedded system. No such command.

How could it be portable?


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
T

Thomas Matthews

Jorge said:
I guess that the point here is how to do this. You are correct, and so
are they. Among any Unix variant, uname is great, and hence it is
protable...

JLR

But it is only protable [sic] to *Nix operating systems.
There are plenty of operating systems out there that
are neither MS Windows or *NIX.

For example, the MS-DOS operating system doesn't have uname.
Neither does: VAX, VRTX, nor custom operating systems.
Don't assume that the entire world has your operating system.
Many embedded systems either have no operating system,
proprietary OS or off-the-shelf OS. Many of which don't
support file systems or the uname command.


--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book
 
B

Buster

Thomas said:
How could it be portable?

It is portable, within a certain domain. You can 'carry' it from one
UNIX-like system to another. The word is being used in a sensible way.
Standard C++ is not "portable" if that means it has to work for every
computer ever built.
 
K

Karl Heinz Buchegger

Buster said:
It is portable, within a certain domain.

Then it is of no interrest to comp.lang.c++
Plain and simple.
You can 'carry' it from one
UNIX-like system to another. The word is being used in a sensible way.
Standard C++ is not "portable" if that means it has to work for every
computer ever built.

Exactly that is the intent of Standard C++.
IF there is a C++ compiler on that machine AND
that compiler is standard compliant AND
the program uses only standard C++ constructs AND
the program doesn't contain undefined behaviour

THEN
the compiler can compile that program and
a program run will produce identical output

Granted: There is only 1 compiler currently known which is fully
standard compliant. But all the others are close to it and the
non standard compliant areas in them mostly deal with 'esoteric'
corners of the language which are not used by many programmers.
 
J

Joe Cipale

Thomas said:
But it is only protable [sic] to *Nix operating systems.
There are plenty of operating systems out there that
are neither MS Windows or *NIX.

The person who posted the original question posted it regarding *nix
operating systems.

Joe
--
#----------------------------------------------------------#
# "Don't fear the penguin!" #
#----------------------------------------------------------#
# Registered Linux user: #309247 http://counter.li.org #
#----------------------------------------------------------#
 
J

Joe Cipale

Karl said:
Then it is of no interrest to comp.lang.c++
Plain and simple.


Exactly that is the intent of Standard C++.
IF there is a C++ compiler on that machine AND
that compiler is standard compliant AND
the program uses only standard C++ constructs AND
the program doesn't contain undefined behaviour

THEN
the compiler can compile that program and
a program run will produce identical output

Granted: There is only 1 compiler currently known which is fully
standard compliant. But all the others are close to it and the
non standard compliant areas in them mostly deal with 'esoteric'
corners of the language which are not used by many programmers.

--

Agreed Karl...
--
#----------------------------------------------------------#
# Penguinix Consulting #
#----------------------------------------------------------#
# Software development, QA and testing. #
# Linux support and training. #
# "Don't fear the penguin!" #
#----------------------------------------------------------#
# Registered Linux user: #309247 http://counter.li.org #
#----------------------------------------------------------#
 
D

Default User

Karl said:
Exactly that is the intent of Standard C++.
IF there is a C++ compiler on that machine AND
that compiler is standard compliant AND
the program uses only standard C++ constructs AND
the program doesn't contain undefined behaviour

the program doesn't contain implementation-defined behavior
the program doesn't contain unspecified behavior
the program doesn't contain locale-specific behavior


I-D is a special case of unspecified behavior, of course.

THEN
the compiler can compile that program and
a program run will produce identical output



Brian Rodenborn
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top