473,769 Members | 2,100 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"K&R" C

I recently got a hold of the sources of Concurrent CP/M-86(circa 1984),
and the system builder, GENCPM is written in a K&R style C. Does GCC
support this syntax? If not, are there any K&R to ANSI converters out
there, or possibly a modern compiler supporting this syntax? Any help
is appreciated.

Thanks,

"msdos6"

Oct 21 '06
16 2170
mkaras wrote:
Is posession of the source code legal?
Can you name a jurisdiction where copyright law speaks to possession (as
opposed to duplication and distribution?)
This is certainly not true in US Federal law, any state law, nor any
European country that I know of.
Perhaps legal advice can be considered topical for comp.lang.c, but only
*correct* legal advice should be tolerated.
Oct 22 '06 #11

"Keith Thompson" <ks***@mib.orgw rote in message
news:ln******** ****@nuthaus.mi b.org...
"msdos6" <ja************ ***@gmail.comwr ites:
>I recently got a hold of the sources of Concurrent CP/M-86(circa 1984),
and the system builder, GENCPM is written in a K&R style C. Does GCC
support this syntax? If not, are there any K&R to ANSI converters out
there, or possibly a modern compiler supporting this syntax? Any help
is appreciated.

The C90 standard is mostly backward-compatible with K&R (pre-ANSI) C,
so you *probably* won't have any serious problems.

(The bad news: any problems you do have are likely to be subtle ones.)
Given this response and if I were OP, I would strongly consider using the
original source as inspiration and writing a conforming program from
scratch, meaning with a generous ability to cut and paste. I'd bet that clc
would serve as a sounding board for it. Lack of conformance could come as
quickly as the main call, but that's certainly not the gotchas that Keith
means. EC
Oct 23 '06 #12
msdos6 wrote:
I recently got a hold of the sources of Concurrent CP/M-86(circa 1984),
and the system builder, GENCPM is written in a K&R style C. Does GCC
support this syntax? If not, are there any K&R to ANSI converters out
there, or possibly a modern compiler supporting this syntax? Any help
is appreciated.
...
It depends on how many of K&R features are really used in the code.
Often people refer to code as being "K&R" just because it includes some
old-style function definitions. Code like this is definitely supported
by GCC.

However, if I remember correctly, the most "hardcore" (oldest?) K&R also
required all struct data members to have unique names across all structs
and allowed almost any data type of the left-hand side of '->' operator,
like

0x12345->some_field_nam e = 3;

Things like that are very unlikely to be supported by any modern compiler.

--
Best regards,
Andrey Tarasevich

Oct 23 '06 #13

jmcgill wrote:
mkaras wrote:
Is posession of the source code legal?

Can you name a jurisdiction where copyright law speaks to possession (as
opposed to duplication and distribution?)
This is certainly not true in US Federal law, any state law, nor any
European country that I know of.
The law in the UK mentions possession. For example, Section 23 of the
Copyright, Designs and Patents Act 1988 runs:

23 Secondary infringement: possessing or dealing with infringing copy

The copyright in a work is infringed by a person who, without the
licence of the copyright owner -
(a) possesses in the course of a business,
(b) sells or lets for hire, or offers or exposes for sale or hire,
(c) in the course of a business exhibits in public or distributes, or
(d) distributes otherwise than in the course of a business to such an
extent as to
affect prejudicially the owner of the copyright,
an article which is, and which he knows or has reason to believe is, an
infringing copy of
the work.
Perhaps legal advice can be considered topical for comp.lang.c, but only
*correct* legal advice should be tolerated.
Possibly best to keep legal advice off clc altogether...

Oct 23 '06 #14

On Sun, 22 Oct 2006, Andrey Tarasevich wrote:
msdos6 wrote:
>I recently got a hold of the sources of Concurrent CP/M-86(circa 1984),
and the system builder, GENCPM is written in a K&R style C. Does GCC
support this syntax? If not, are there any K&R to ANSI converters out
there, or possibly a modern compiler supporting this syntax? Any help
is appreciated.

It depends on how many of K&R features are really used in the code.
Often people refer to code as being "K&R" just because it includes some
old-style function definitions. Code like this is definitely supported
by GCC.

However, if I remember correctly, the most "hardcore" (oldest?) K&R also
required all struct data members to have unique names across all structs
and allowed almost any data type of the left-hand side of '->' operator,
like

0x12345->some_field_nam e = 3;

Things like that are very unlikely to be supported by any modern compiler.
FWIW, I just tested on Green Hills' C compiler, with the -k+r option,
and it does support the 0x12345->some_field_nam e syntax. (It allows
field names to be duplicated, too, as long as any ambiguous access
uses a field name all of whose appearances are at the same offset.)

I agree that any free-or-cheap compiler that the OP is likely to
have, is very unlikely to support that syntax. But /someone/ is
always willing to pay a lot for backwards compatibility. :)

-Arthur,
conflict of interest
Oct 23 '06 #15
It seems that OpenWatcom will compile it correctly as long as a fix
some type mismatches, and remove the CP/M dependant code.

As for the legality of this source code, there are 2 liscences for CP/M
which I have considered:
1) If you search for the CP/M license, you will see the original
caldera license. This license I believe is no longer in effect. It
states that I may use the source code for non-commercial use.

2) If you go onto cpm.z80.de, you will see the reissued license posted
on the site by Lineo. It's a bit sparse, but it seems to say the same
thing.

Oct 24 '06 #16

<gw****@aol.com wrote in message
news:11******** **************@ k70g2000cwa.goo glegroups.com.. .
>
jmcgill wrote:
>mkaras wrote:
Is posession of the source code legal?

Can you name a jurisdiction where copyright law speaks to possession (as
opposed to duplication and distribution?)
This is certainly not true in US Federal law, any state law, nor any
European country that I know of.

The law in the UK mentions possession. For example, Section 23 of the
Copyright, Designs and Patents Act 1988 runs:

23 Secondary infringement: possessing or dealing with infringing copy

The copyright in a work is infringed by a person who, without the
licence of the copyright owner -
(a) possesses in the course of a business,
(b) sells or lets for hire, or offers or exposes for sale or hire,
(c) in the course of a business exhibits in public or distributes, or
(d) distributes otherwise than in the course of a business to such an
extent as to
affect prejudicially the owner of the copyright,
an article which is, and which he knows or has reason to believe is, an
infringing copy of
the work.
>Perhaps legal advice can be considered topical for comp.lang.c, but only
*correct* legal advice should be tolerated.

Possibly best to keep legal advice off clc altogether...
That's not advice; it's a statute. I certainly agree that it is possibly
best to keep legal advice off clc. EC
Oct 24 '06 #17

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

Similar topics

1
11443
by: DrTebi | last post by:
Hello, I have the following problem: I used to "encode" my email address within links, in order to avoid (most) email spiders. So I had a link like this: <a href="mailto:DrTebi@yahoo.com">DrTebi</a> This would work like a regular mailto link in any browser, but wouldn't be visible to spiders if they don't have a function to decode it.
2
1849
by: DC Gringo | last post by:
I have an image control (that pulls an image off an ESRI map server): <ASP:IMAGE ID="imgZonedCountry" RUNAT="server"></ASP:IMAGE> In the code behind I am setting the ImageURL to a String value with url parameters like this: imgZonedCountry.ImageUrl = "http://server/servlet/com.esri.wms.Esrimap?param1=x&param2=y When it serves up the page, I'm getting "&amp;" in place of the "&"
2
20534
by: Eric Osman | last post by:
Hi, I'm looking for a javascript function that will convert input such as this: <CLUB Code=" into this: &lt;CLUB Code=&quot;
4
14803
by: barney | last post by:
Hello, I' m using .NET System.Xml.XmlDOcument. When I do the following: XmlDocument xml = new XmlDocument(); xml.Load("blah"); .... xml.Save("blub"); I've got the problem that the following expression: .... snip ...
1
3980
by: st | last post by:
Hi, I'm using xmlDocument.Save(xmlTextWriter) to create an Excel-readable file. All works well, except where I've replaced the carriage return chars in the .innertext to XML-compliant " "; It gets changed to "&amp;#10" and doesn't render new lines in the Excel sheet. Can anyone help? Many thanks,
5
3447
by: martin | last post by:
Hi, I would be extremly grateful for some help on producing an xml fragemt. The fragment that I wish to produce should look like this <Addresses> <Address>&qout;Somebody's Name&quot; &lt;me@mydomain.com&gt;</Address> </Addresses>
7
2806
by: DC Gringo | last post by:
I am having a bear of a time with setting a URL query string as a text value in a dropdownlist and Server.URLEncode does not seem to do its job. theFullLink = theLinkPrefix & theImageryTypeTrimmed & Server.URLEncode("&f=") ddlMyDropDownList.Items.Add(New ListItem("MyTextValue", theFullLink & "af")) Which puts out the following HTML: <option value="~/folder/page.aspx?param1=value1%26f%3daf">-
14
5935
by: Arne | last post by:
A lot of Firefox users I know, says they have problems with validation where the ampersand sign has to be written as &amp; to be valid. I don't have Firefox my self and don't wont to install it only because of this, so I hope some of you gurus can enlighten me with this :) In what circumstances can the "&amp;" in the source code be involuntary changed to "&" by a browser when or other software, when editing and uploading the file to the web...
13
2804
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is produced like: <title>my very long title blab la blab la Blabla bla </title> Importer also has got problems with it
0
9579
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, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
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
10208
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
8867
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...
0
6662
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
5294
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
3952
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
3558
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2812
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.