Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jan 2017 17:42:21 -0500
From:      Sergei Akhmatdinov <sakhmatd@riseup.net>
To:        freebsd-questions@freebsd.org
Subject:   Re: BSD C Compiler to recompile many lines of K&R Whitebook C.
Message-ID:  <20170120174221.55bcff60@riseup.net>
In-Reply-To: <c2cd5a57-bfa8-e4e8-a4c8-243594a4bd22@eircom.net>
References:  <c2cd5a57-bfa8-e4e8-a4c8-243594a4bd22@eircom.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--Sig_/QxaReVH_R5qkw=d_kB7SSUJ
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

On Fri, 20 Jan 2017 21:40:29 +0000
spirals <spirals@eircom.net> wrote:
> Hi All, I am a newcomer to your list, with a rather unusual question,=20
> and this is definitely not a windup folks.
Maybe more of a freebsd-hackers question here, but here will do. :)

> How far back in BSD releases would I need to get (the source code to=20
> build)  a C compiler that will accept "bog standard" K&R Whitebook C=20
> (1st ed), rather than throwing the thousands of warnings and error=20
> messages the current gcc on Linux 7 (Wheezy) is doing.
You may wish to try compiling with -traditional or -c89, much of pre-ANSI K=
&R
should be compatible.

Out of curiosity, is there a specific reason you want to compile pre-ANSI K=
&R?
Not to say there wouldn't be any, just curious myself. K&R 2nd ed was rewri=
tten
for ANSI.

> I ask this as I understand from reading the documents the FreeBSD=20
> compiler is based on gcc.
FreeBSD uses clang + llvm. Since gcc is licensed under GPL, clang doesn't
reuse any gcc code.

> I have not yet installed FreeBSD, but asking this question as part of a=20
> process of evaluating evaluating it, based on this specific requirement=20
> to compile K&R C.
>=20
> The K&R C consists of many lines of code known to compile clean and run=20
> OK when it was originally written.
Since the original K&R was written, ANSI was created to avoid the assembly
language problem of having a million different standards.

If your goal is to learn C, go for the ANSI-fied version of K&R.

Cheers,
--=20
Sergei Akhmatdinov

My GPG public key:
gpg --keyserver pgp.mit.edu --recv-keys AD800D99

--Sig_/QxaReVH_R5qkw=d_kB7SSUJ
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEFByDSlcPK9lAgiNNxKRHP62ADZkFAliCkk0ACgkQxKRHP62A
DZksQg//T/goGKeNRuc6txmVZLONcXrQQN/oXG0mlSss+uGQjUiBqmcLotrmezR2
TTlDuiRr5xaAdEWKZQXmH5IjUzChTm4bdSjsQ2ih6xUKRqEKE6FHvi9rMnkyvUdF
d/AicGMtg3GC0FVWsgVjxCUZyPaJHpeZ5P7QRkIem5AuXna7bzue/OfBxgThZutG
3texEOts/AG/vDO0IyRU05Iysq9b03j80SfqyR5TkaaPzcYuGdBc9VlOW7W+kYBM
fiE2BlhVLdNRp4lSyb0zdvM2BQLB17An/COAydUio+em/y2KNCrwccfaad6E5Xjs
KbwQUQck8Q7AHWzDS18PNJuHUTMAm6XhM7C3oUETBp9X9xETi4hBT0W+Xmsfhu0l
Qm3khtXmTVmiEjlL5B890Pn/AhzWk7cwubQ1n/zKmehr3qn0GoCl2Pqg5UCQ9a41
8LxERSoQOBvcOEZ0b2FEdyycIKirTgoveoEXqzU0w09SP517R5IzJgkg60h/vKEx
nJuNy0155BBiwV9GWokL7Y7ru/bRvGErFeiFzHxjypslKBqd1T768QKDg1zS0/oo
OT8+2e8qVGy7JeVePEM7nHUOl4H37mT0seOcE/Kla9PxdMfUHxq0Qhwl5gACCKaW
5QNe+I6uzevNOa2cp/MemqtWPigbJq1YxjqxT3vEycVlWVPriyw=
=lGpf
-----END PGP SIGNATURE-----

--Sig_/QxaReVH_R5qkw=d_kB7SSUJ--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170120174221.55bcff60>