How programming in C got me in trouble with the law

O

Old Wolf

At my trial I insisted I was not responsible for the spam, that it was
the fault of RealC-32. But a representative from the company pointed
out that they were completely in compliance with the C standard, which
allowed them free reign to do as they pleased with my computer once I
dereferenced that uninitialized pointer.

Actually that is an interesting point. Supposing this compiler did
actually exist, who should be found to be responsible for the spam?

Assuming you answer 'the makers of RealC-32', it seems there is a
sliding scale between this case, and the case of a regular program
on a regular compiler accidentally formatting the harddrive due to UB.
 
W

William Hughes

Old said:
Actually that is an interesting point. Supposing this compiler did
actually exist, who should be found to be responsible for the spam?

Assuming you answer 'the makers of RealC-32', it seems there is a
sliding scale between this case, and the case of a regular program
on a regular compiler accidentally formatting the harddrive due to UB.

Well the makers should be responsible for behaviour that
a reasonble man would not anticipate.

So if the makers put a big red notice on the front of every
box saying "Warning, if you compile any program that
invokes behavious undefinied by the C standard, this
compiler will create an executable that sends out spam",
the makers would probably be fine (although they would
not sell many compilers). Otherwise they should
be responsible for the spam because a resonable man would
not expect a simple programming error to result
in a spamming executable.

On the other hand a reasonable man should expect that
a simple programming error would cause an
executable that attemps to execute at random locations
to be produced. If he runs this executable in
a system where such an executable can cause
damage, he has no one but himself to blame for
the damage.

- William Hughes
 
K

Kenneth Brody

William said:
Old Wolf wrote: [...]
Actually that is an interesting point. Supposing this compiler did
actually exist, who should be found to be responsible for the spam?

Assuming you answer 'the makers of RealC-32', it seems there is a
sliding scale between this case, and the case of a regular program
on a regular compiler accidentally formatting the harddrive due to UB.

Well the makers should be responsible for behaviour that
a reasonble man would not anticipate.

So if the makers put a big red notice on the front of every
box saying "Warning, if you compile any program that
invokes behavious undefinied by the C standard, this
compiler will create an executable that sends out spam",
the makers would probably be fine (although they would
not sell many compilers). Otherwise they should
be responsible for the spam because a resonable man would
not expect a simple programming error to result
in a spamming executable.

What if the warning said:

Warning! If you compile any program that invokes undefined
behavior, the results may be *ANYTHING*, including, but not
limited to, the melting of your CPU, demons flying out of
your nose, or the slaying of your first-born male child. We
are not responsible for the results of your use of undefined
behavior.

[...]

--
+-------------------------+--------------------+-----------------------+
| Kenneth J. Brody | www.hvcomputer.com | #include |
| kenbrody/at\spamcop.net | www.fptech.com | <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------+
Don't e-mail me at: <mailto:[email protected]>
 
W

William Hughes

Kenneth said:
William said:
Old Wolf wrote: [...]
Actually that is an interesting point. Supposing this compiler did
actually exist, who should be found to be responsible for the spam?

Assuming you answer 'the makers of RealC-32', it seems there is a
sliding scale between this case, and the case of a regular program
on a regular compiler accidentally formatting the harddrive due to UB.

Well the makers should be responsible for behaviour that
a reasonble man would not anticipate.

So if the makers put a big red notice on the front of every
box saying "Warning, if you compile any program that
invokes behavious undefinied by the C standard, this
compiler will create an executable that sends out spam",
the makers would probably be fine (although they would
not sell many compilers). Otherwise they should
be responsible for the spam because a resonable man would
not expect a simple programming error to result
in a spamming executable.

What if the warning said:

Warning! If you compile any program that invokes undefined
behavior, the results may be *ANYTHING*, including, but not
limited to, the melting of your CPU, demons flying out of
your nose, or the slaying of your first-born male child. We
are not responsible for the results of your use of undefined
behavior.


Then the makers would be saying that the use of the
program might be dangerous indeed
No one would purchase the compiler. This is an
indication that conformance to the C standard is
not a sufficient condition for comercial success.
(DUH!)

So when you are discussing more than whether
a given program has behaviour specified by the C standard you
have to take other factors into acount. However, the
restricted question of whether a given program has
behaviour specified by the C standard is an
interesting question. Indeed, it is often discussed on comp.lang.c

- William Hughes
 
B

Ben Pfaff

William Hughes said:
Then the makers would be saying that the use of the
program might be dangerous indeed
No one would purchase the compiler. This is an
indication that conformance to the C standard is
not a sufficient condition for comercial success.

A popular compiler comes with strong warnings attached also:

NO WARRANTY

11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

However, these warnings have not prevented it from becoming
widely used.
 
K

Keith Thompson

Kenneth Brody said:
William said:
Old Wolf wrote: [...]
Actually that is an interesting point. Supposing this compiler did
actually exist, who should be found to be responsible for the spam?

Assuming you answer 'the makers of RealC-32', it seems there is a
sliding scale between this case, and the case of a regular program
on a regular compiler accidentally formatting the harddrive due to UB.

Well the makers should be responsible for behaviour that
a reasonble man would not anticipate.

So if the makers put a big red notice on the front of every
box saying "Warning, if you compile any program that
invokes behavious undefinied by the C standard, this
compiler will create an executable that sends out spam",
the makers would probably be fine (although they would
not sell many compilers). Otherwise they should
be responsible for the spam because a resonable man would
not expect a simple programming error to result
in a spamming executable.

What if the warning said:

Warning! If you compile any program that invokes undefined
behavior, the results may be *ANYTHING*, including, but not
limited to, the melting of your CPU, demons flying out of
your nose, or the slaying of your first-born male child. We
are not responsible for the results of your use of undefined
behavior.

[...]

Then a user suing the compiler vendor for damages would not be able to
cite violation of the ISO C standard. The question of whether he'd be
able to cite anything else, or whether such a warning has any *legal*
significance, is well beyond the scope of this newsgroup.
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top