473,396 Members | 1,996 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ISO C incompatibilities

Greetings,

I have some old C code that quit compiling on Linux because the compiler
doesn't like the function prototypes not matching the function
definitions. I know Sun has a compiler switch that overrides this, but
I can't seem to find how to do it on Linux.

I'm using "gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"

I use the -U__STDC__ directive when I do the compile, but the compile
errors out. The error message is:

"You need a ISO C conforming compiler to use the glibc headers"

If I take the switch out, some of it compiles and even links...

You might call me lazy, but I would rather not make coding changes.
This product runs on many OS's and I'd have to compile/test/package on
all of them.

Thank you for reading my post,
Dean
Nov 14 '05 #1
6 4449
djk9636 wrote:
Greetings,

I have some old C code that quit compiling on Linux because the compiler
doesn't like the function prototypes not matching the function
definitions.

Well, you are on your own! To conform to the C language, prototypes must
match function definitions. And if they don't match, then the function
may well not do what you expect in any case.

Robert
Nov 14 '05 #2
On Thu, 27 May 2004 21:02:36 +0000, djk9636 wrote:
I have some old C code that quit compiling on Linux because the compiler
doesn't like the function prototypes not matching the function
definitions. I know Sun has a compiler switch that overrides this, but
I can't seem to find how to do it on Linux.


Google.com is your friend. Try searching for the "mkptypes" program:
it will transform your K&R code into ANSI-style code. Add an
additional step to your Makefile's to do the transformation.

HTH.

Nov 14 '05 #3
On Thu, 27 May 2004 21:02:36 GMT, djk9636 <dj*****@boeing.com> wrote:
I have some old C code that quit compiling on Linux because the compiler
doesn't like the function prototypes not matching the function
definitions.


You should be grateful :-)

I have no suggestion except the obvious one - fix the prototypes. Then
you can fix all the places where functions are called with the wrong
parameters.

If the problem is systematic, you might be able to write a translator
in Awk or Perl which does most of the work for you.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 14 '05 #4
> You might call me lazy, but I would rather not make coding changes.
This product runs on many OS's and I'd have to compile/test/package on
all of them.


But this product doesn't run. It *seems* to run until you unexpectedly
receive a strange message, the program disappears and the
user has lost all data.

Crash.

If the wrong calls aren't used often this "product" gives you
the impression that is running but actually it is a flawed
product.

If you do not want to change it throw it away.

Nov 14 '05 #5
djk9636 wrote:
Greetings,

I have some old C code that quit compiling on Linux because the compiler
doesn't like the function prototypes not matching the function
definitions. I know Sun has a compiler switch that overrides this, but
I can't seem to find how to do it on Linux.

I'm using "gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"

I use the -U__STDC__ directive when I do the compile, but the compile
errors out. The error message is:

Drop that, and try the -ansi switch
Nov 14 '05 #6
I want to thank you all for your replies. The idea of using mkptypes
would be faster in the short term, (my boss would probably like that,)
but in the long term coding changes will be necessary anyway. Other
than those options, I'd need to rewrite the whole application...

Thanks Again,
-Dean

djk9636 wrote:

Greetings,

I have some old C code that quit compiling on Linux because the compiler
doesn't like the function prototypes not matching the function
definitions. I know Sun has a compiler switch that overrides this, but
I can't seem to find how to do it on Linux.

I'm using "gcc version 3.2.2 20030222 (Red Hat Linux 3.2.2-5)"

I use the -U__STDC__ directive when I do the compile, but the compile
errors out. The error message is:

"You need a ISO C conforming compiler to use the glibc headers"

If I take the switch out, some of it compiles and even links...

You might call me lazy, but I would rather not make coding changes.
This product runs on many OS's and I'd have to compile/test/package on
all of them.

Thank you for reading my post,
Dean

Nov 14 '05 #7

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

Similar topics

3
by: Konman | last post by:
I am new to php and have run into one problem with one of the scripts I have found and I am unsure of how to correct the problem. My Web Host is currently running PHP Version 4.1.2 and PHP Info...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
0
by: Peter Maas | last post by:
I tried to find a comprehensive list of Python backward incompatibilities without success. What is the fastest way to compile such a list (with code examples / expected results)? Thanks for your...
2
by: adsheehan | last post by:
Hi all, Has anyone experienced issues incompatible versions of the above? On solaris, we are experiencing suspect crashes & memory leaks? How do I determine which versions are proven to be...
3
by: Gary Dunne | last post by:
Hi, Sorry if this is deemed to be a cross post (I also posted to the microsoft.public.xml) (Using .NET 2003, VB, C# on a Win2k PC) I'm trying to retrieve nodes from an XML doc by name. I...
32
by: David Isaac | last post by:
I have no experience with database applications. This database will likely hold only a few hundred items, including both textfiles and binary files. I would like a pure Python solution to the...
0
by: user923005 | last post by:
I found this link interesting: http://david.tribble.com/text/cdiffs.htm
4
by: tromboneman | last post by:
Hi! I haven't been coding in Javascript/PHP very long, but this is the first thing some time and Google can't solve. Through my hours of debugging, I have narrowed the problem down to...
16
by: Matthew | last post by:
Hi everyone, i'm really newbie in IBM DB2 but I have to know how is IBM DB2 Dialcet called? In oracle we have PL/SQL, in SQL Server we have T-SQL. What about DB2? Is it SQL PL, or DB2 SQL...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
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...
0
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,...

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.