473,839 Members | 1,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

code portability

My question is more generic, but it involves what I consider ANSI standard C
and portability.

I happen to be a system admin for multiple platforms and as such a lot of
the applications that my users request are a part of the OpenSource
community. Many if not most of those applications strongly require the
presence of the GNU compiling suite to work properly. My assumption is that
this is due to the author/s creating the applications with the GNU suite.
Many of the tools requested/required are GNU replacements for make,
configure, the loader, and lastly the C compiler itself. Where I'm going
with this is, has the OpenSource community as a whole committed itself to at
the very least encouraging its contributing members to conform to ANSI
standards of programming?

My concern is that as an admin I am sometimes compelled to port these
applications to multiple platforms running the same OS and as the user
community becomes more and more insistent on OpenSource applications will
gotcha's appear due to lack of portability in coding? I fully realize that
independent developers may or may not conform to standards, but again is it
at least encouraged?

11.32 of the FAQ seemed to at least outline the crux of what I am asking.
If I loaded up my home machine to the gills will all open source compiler
applications (gcc, imake, autoconfig, etc....) would my applications that I
compile and link and load conform?
Aug 1 '06
239 10352
Richard Bos wrote:
jacob navia <ja***@jacob.re mcomp.frwrote:

>>You should also avoid long double. This did not exist in C89.


Oh, look, isn't it just *darling*? I'd ask if we could keep it, but
frankly I'd prefer if it kept it and its rampant lack of knowledge about
C to itself.

Richard
I stand corrected. Apparently C89 did have long double.

Aug 1 '06 #11
jacob navia wrote:
Except it is valid "C" and many [most] C compilers do in fact support
it. In fact the only compiler I know of in productive use on 32/64 bit
boxes that doesn't is MSVC and there is a simple workaround (it has a
64-bit type just not called long long0.

See?

Not portable then.
Um, ok but it's trivial to work around. you can still use

ulong64 a, b, c;

a += b;
c *= b;
b ^= a;

After you find a typedef for ulong64. On real compilers it's "unsigned
long long" and on msvc it's "unsigned __int64" [irrc].

That's a stupidly quick fix. I support it in LibTomCrypt since day-1
and haven't looked back since.
So your "advice" is ignorant ranting lunatic bullshit.

WOW what nice arguments
Well given my software is used on pretty much every 32 and 64-bit C
platform you can think of I'd say I'm abundantly qualified to talk
about getting code to work portably.

Your rants [which I think are just a joe-job against the real Jacob]
are pure troll ignorant trash.
Or ... not use crappy toy compilers.

Exactly. Use C99.
Um, no read what I'm actually writing. Real compilers supported it
before C99.
12345676UL

That's valid C89. Shut the fuck up.

This is not portable to 16 bit machines. Per standard (C99) the minimum
integer size is 16 bit only. I would be surprised that C89 was
different.
um,

unsigned long = 1234567UL;

That's valid C89 code. Any compiler that doesn't support that is not a
C89 compiler and is not worth discussing [hint: BYTE Small-C from 1985
is not a C89 compiler!]
Array indecies only have to be of integer type.

Yes, and the minimum required int size is 16 bits.
Yes, so if your malloc of 100000 bytes fails you can exit gracefully.
I agree that static or globals of huge size are a bad idea (in general
they're a bad idea anyways).

That said, you generally don't assume that a program that uses huge
arrays will port directly to a 8-bit host anyways?

By your logic, C is a bad language because Apache2 won't build on my
8051.

"Portable" code has limits. But between tiny alarm clock programs and
vast server applications is an entire spectrum of applications that
work in a variety of environments. For instance, Info-Zip was being
used in 16, 32 and 64 bit platforms (of various endianesses) at the
same time.

Your rants are ignorant and shameful. My guess is you haven't spent 5
minutes trying to write portable code and you're just upset that you
think you're moot since you've missed the boat.

How about you be a team player for a change?

Tom

Aug 1 '06 #12
On Mon, 31 Jul 2006 20:52:16 -0700, "Eigenvecto r"
<m4********@yah oo.comwrote:
Where I'm going
with this is, has the OpenSource community as a whole committed itself to at
the very least encouraging its contributing members to conform to ANSI
standards of programming?
No, because there's no such entity as "the OpenSource community as a
whole." Individual projects may have guidelines.

--
Al Balmer
Sun City, AZ
Aug 1 '06 #13
Tom St Denis wrote:
[...]
Aim for C89 compliance and you pretty much got things nailed. Keep in
mind that many compilers supported various C99 features even back then.
E.g., long long has been supported for a while and ALL unix C
compilers I've seen support it [even the ones released in the mid 90s].
[...]

SCO OpenServer 5 doesn't have "long long" support, and the compiler
says it's dated "18Feb03".

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer .h|
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:Th***** ********@gmail. com>

Aug 1 '06 #14

Kenneth Brody wrote:
Tom St Denis wrote:
[...]
Aim for C89 compliance and you pretty much got things nailed. Keep in
mind that many compilers supported various C99 features even back then.
E.g., long long has been supported for a while and ALL unix C
compilers I've seen support it [even the ones released in the mid 90s].
[...]

SCO OpenServer 5 doesn't have "long long" support, and the compiler
says it's dated "18Feb03".
Who the fuck uses SCO? When I say UNIX I mean IRIX, Solaris, HP-UX,
AIX, etc...

SCO is the OS of choice for the anti-christ.

Tom

Aug 1 '06 #15
In article <11************ **********@i42g 2000cwa.googleg roups.com>,
Tom St Denis <to********@gma il.comwrote:
>Who the fuck uses SCO? When I say UNIX I mean IRIX, Solaris, HP-UX,
AIX, etc...
The OpenGroup certified UNIXes are [specific versions of]

AIX (IBM)
IRIX (SGI)
NCR UNIX (NCR)
Solaris (Sun, Fujitsu)
Tru64 (HP)
UnixWare (Caldera, SCO)
UX/4800 (NEC)
Regardless of what one thinks of SCO, they -are- one of the few
certified UNIX.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
Aug 1 '06 #16
jacob navia wrote:
You should also avoid long double. This did not exist in C89.
Jacob Navia once again proves he knows nothing. From the C89 ANSI
standard, even before the ISO C90 standard:

3.1.2.5 Types
[...]
There are three floating types, designated as float , double , and
long double . The set of values of the type float is a subset of the
set of values of the type double ; the set of values of the type
double is a subset of the set of values of the type long double.

When Jacob is not pretending that his compiler's non-standard features
define the world, he pretends that C does not include what it has
included for 17 years. Is he ignorant or dishonest?
Aug 1 '06 #17
Martin Ambuhl said:

<snip>
>
When Jacob is not pretending that his compiler's non-standard features
define the world, he pretends that C does not include what it has
included for 17 years. Is he ignorant or dishonest?
Hanlon's Razor applies.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Aug 1 '06 #18
Walter Roberson wrote:
In article <11************ **********@i42g 2000cwa.googleg roups.com>,
Tom St Denis <to********@gma il.comwrote:
>Who the fuck uses SCO? When I say UNIX I mean IRIX, Solaris, HP-UX,
AIX, etc...

The OpenGroup certified UNIXes are [specific versions of]

AIX (IBM)
IRIX (SGI)
NCR UNIX (NCR)
Solaris (Sun, Fujitsu)
Tru64 (HP)
UnixWare (Caldera, SCO)
UX/4800 (NEC)
Regardless of what one thinks of SCO, they -are- one of the few
certified UNIX.
Also it *is* still used. I even have a SCO box in the office for doing
critical fixes to an old version of our software. Fortunately I've
persuaded the company not to support SCO for the current version.
--
Flash Gordon
Still sigless on this computer.
Aug 1 '06 #19
Flash Gordon wrote:
Walter Roberson wrote:
>In article <11************ **********@i42g 2000cwa.googleg roups.com>,
Tom St Denis <to********@gma il.comwrote:
>>Who the fuck uses SCO? When I say UNIX I mean IRIX, Solaris, HP-UX,
AIX, etc...

The OpenGroup certified UNIXes are [specific versions of]

AIX (IBM)
IRIX (SGI)
NCR UNIX (NCR)
Solaris (Sun, Fujitsu)
Tru64 (HP)
UnixWare (Caldera, SCO)
UX/4800 (NEC)

Regardless of what one thinks of SCO, they -are- one of the few
certified UNIX.

Also it *is* still used. I even have a SCO box in the office for doing
critical fixes to an old version of our software. Fortunately I've
persuaded the company not to support SCO for the current version.
[So off-topic that I set follow-ups.]

You too, huh? I actually had to rescue my OpenServer CDs from the
"coaster heap" in order to pull together a system as a good-faith move
for a customer.

It's true: people still use this stuff.
Aug 1 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1848
by: Lefevre | last post by:
Hello. I recently discovered that this kind of code : | struct Object | { | string f() { return string("Toto"); } | } | | int main( ... )
0
9696
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10290
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9425
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7827
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7015
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5681
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5865
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4482
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.