473,839 Members | 1,540 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 10358
Al Balmer <al******@att.n etwrites:
On Wed, 09 Aug 2006 17:19:35 +0200, Richard <rg****@gmail.c omwrote:
>>en******@yaho o.com writes:
>>Ian Collins wrote:

It may not be popular in these parts, but I'd recommend you become
familiar with Test Driven Development as a way of enhancing the quality
of your code, both in design and implementation.

Kindly take your TDD proselytizing to a newsgroup where
it's topical.

Its called a developing thread.

A new buzzword? I call it a thread that's become off-topic, and should
be ended or moved to an appropriate venue.
What a surprise.
Aug 9 '06 #181
Al Balmer said:
On Wed, 09 Aug 2006 07:22:32 +0000, Richard Heathfield
<in*****@invali d.invalidwrote:
>>Flash Gordon said:
>>Frederick Gotham wrote:

<snip>

Posting here, and over on comp.lang.c++, I am disconcerted by the ever-
frequent mention of business.

Many of us here earn our living writing software.

Many of us here use third-party libraries written in C. That does not mean
that third-party libraries are topical in clc.
No one is actually discussing business. What does happen is that in
the course of discussion, people draw from their real-world experience
for purposes of exposition. If programming style is topical, surely
programming style in the context of the real world is topical. You
can't discuss the merits of a style without giving reasons for it.
All true.
For
most of us professionals, the reasons relate to real-world
considerations such as maintainability and working with other
programmers. For Frederick, the reasons appear to be that he enjoys
flouting convention, and likes to make up stuff as he goes along.
That's OK, he's a hobbyist, and need only please himself.
Again, all true.
However, he
should make an effort to understand that professional programmers have
other goals and other criteria, and not too surprisingly, those goals
and criteria relate to their jobs.
But why should he make the effort? It's not as if he's asking us to read his
code. It's not as if he's asking for help. It's not as if he's ever going
to /work/ as a programmer. So why shouldn't he code as he likes? Just so
long, of course, that he doesn't ever expect to work as a programmer, or
get help from us with his code, or get us to read his code.

--
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 9 '06 #182
Richard Heathfield <in*****@invali d.invalidwrites :
Al Balmer said:
>On Wed, 09 Aug 2006 07:22:32 +0000, Richard Heathfield
<in*****@inval id.invalidwrote :
>>>Flash Gordon said:

Frederick Gotham wrote:

<snip>

Posting here, and over on comp.lang.c++, I am disconcerted by the ever-
frequent mention of business.

Many of us here earn our living writing software.

Many of us here use third-party libraries written in C. That does not mean
that third-party libraries are topical in clc.
No one is actually discussing business. What does happen is that in
the course of discussion, people draw from their real-world experience
for purposes of exposition. If programming style is topical, surely
programming style in the context of the real world is topical. You
can't discuss the merits of a style without giving reasons for it.

All true.
>For
most of us professionals, the reasons relate to real-world
consideratio ns such as maintainability and working with other
programmers. For Frederick, the reasons appear to be that he enjoys
flouting convention, and likes to make up stuff as he goes along.
That's OK, he's a hobbyist, and need only please himself.

Again, all true.
>However, he
should make an effort to understand that professional programmers have
other goals and other criteria, and not too surprisingly, those goals
and criteria relate to their jobs.

But why should he make the effort? It's not as if he's asking us to read his
code. It's not as if he's asking for help. It's not as if he's ever going
to /work/ as a programmer. So why shouldn't he code as he likes? Just so
long, of course, that he doesn't ever expect to work as a programmer, or
get help from us with his code, or get us to read his code.
But the point is, he is doing exactly that.

And he is arguing the toss that a programmer should be able to do as
they like if *they* understand it. More topical to general programming
of course, but C is especially good at becoming confusing as it is
without someone "rewriting" the general rules. As for arguing that he
could & should reqrite the coding standards on a large project, well,
for those of us here who have worked in the real world, we know it to be
laughably ludicrous.
>
--
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 9 '06 #183
Richard wrote:
But like the post you criticised, this is OT. Take it to alt.pedant or
somesuch.
Topicality is always on topic.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
Aug 9 '06 #184
Philip Potter posted:
Why mix these things up? Don't you think it
makes more sense to write:

<function-modifiers<retur n typeFunc();

No, I prefer:

<type<type specifiers<cons t<volatile<stat ic/extern<inline<n ame>

"name" might include pointer-ness, or function-ness, or array-ness. Something
like:

long unsigned const volatile static inline (*Func(void))[6]
{
long unsigned volatile static arr[6] = {1,2,4,8,16,32} ;

return &arr;
}

int main(void)
{
long unsigned const volatile (*const p)[6] = Func();
}

--

Frederick Gotham
Aug 9 '06 #185

In article <87************ @mail.com>, Richard <rg****@gmail.c omwrites:
"Philip Potter" <ph***********@ xilinx.comwrite s:
<we******@gmail .comwrote in message
news:11******** *************@i 42g2000cwa.goog legroups.com...
*something in which the content was lost in a swathe of personal attacks*
Calm down. You do not make your points any clearer by insulting others and
ignoring their arguments. While I think that *what* you were saying has some
validity [1], the way you said it was completely OTT.

He wasnt overly rude : just somewhat miffed, as a lot of posters get,
when dealing with the typically overtly imperious tone taken by a
certain poster.
You think *Keith* was "imperious" , compared to Paul? You may have the
oddest sense of prose style I have ever encountered, and I used to
teach literature at university.

--
Michael Wojcik mi************@ microfocus.com
Aug 9 '06 #186
Frederick Gotham wrote:
Philip Potter posted:
>Why mix these things up? Don't you think it
makes more sense to write:

<function-modifiers<retur n typeFunc();


No, I prefer:

<type<type specifiers<cons t<volatile<stat ic/extern<inline>
<name>
While that's valid, please keep in mind that the ability to put
static/extern/inline in the middle of a declaration is marked
an "obsolescen t" feature.
Aug 9 '06 #187
On Wed, 09 Aug 2006 16:37:46 +0000, Richard Heathfield
<in*****@invali d.invalidwrote:
>However, he
should make an effort to understand that professional programmers have
other goals and other criteria, and not too surprisingly, those goals
and criteria relate to their jobs.

But why should he make the effort?
For whatever reason he's making the effort to post here :-)
>It's not as if he's asking us to read his
code. It's not as if he's asking for help. It's not as if he's ever going
to /work/ as a programmer. So why shouldn't he code as he likes? Just so
long, of course, that he doesn't ever expect to work as a programmer, or
get help from us with his code, or get us to read his code.
--
Al Balmer
Sun City, AZ
Aug 9 '06 #188
Harald van =?UTF-8?B?RMSzaw==?= posted:
>No, I prefer:

<type<type specifiers<cons t<volatile<stat ic/extern<inline>
<name>

While that's valid, please keep in mind that the ability to put
static/extern/inline in the middle of a declaration is marked
an "obsolescen t" feature.

I wasn't aware of that. Which Standard says that you can't put them in
whatever order you like?

So where must they be put, and in what order?

--

Frederick Gotham
Aug 9 '06 #189
Frederick Gotham wrote:
Harald van =?UTF-8?B?RMSzaw==?= posted:
>>No, I prefer:

<type<type specifiers<cons t<volatile<stat ic/extern<inline>
<name>

While that's valid, please keep in mind that the ability to put
static/extern/inline in the middle of a declaration is marked
an "obsolescen t" feature.


I wasn't aware of that. Which Standard says that you can't put them in
whatever order you like?

So where must they be put, and in what order?
No standard says that. Obsolescent means it may be considered for removal in
a future standard, and is discouraged, but is currently still supported.
What n1124 says is:

Introduction p2:

Certain features are obsolescent, which means that they may be considered
for withdrawal in future revisions of this International Standard. They are
retained because of their widespread use, but their use in new
implementations (for implementation features) or new programs (for language
[6.11] or library features [7.26]) is discouraged.

6.11.5 Storage-class specifiers
The placement of a storage-class specifier other than at the beginning of the
declaration specifiers in a declaration is an obsolescent feature.

I was overly broad, though, sorry: inline is not a storage-class specifier.
It's a function specifier, and there does not seem to be a similar note for
function specifiers.
Aug 9 '06 #190

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
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10906
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10585
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10292
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...
1
7828
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
5682
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...
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
4064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3132
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.