From owner-freebsd-questions@freebsd.org Fri Jan 20 22:42:25 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 525AACB9E56 for ; Fri, 20 Jan 2017 22:42:25 +0000 (UTC) (envelope-from sakhmatd@riseup.net) Received: from mx1.riseup.net (mx1.riseup.net [198.252.153.129]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BFCE1058 for ; Fri, 20 Jan 2017 22:42:24 +0000 (UTC) (envelope-from sakhmatd@riseup.net) Received: from piha.riseup.net (unknown [10.0.1.163]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.riseup.net (Postfix) with ESMTPS id 0D65E1A05C0 for ; Fri, 20 Jan 2017 22:42:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1484952144; bh=9o+eQkpf0JDidKwt/jf78NME8LFTpEuelv9S3wz7xYI=; h=Date:From:To:Subject:In-Reply-To:References:From; b=BUgf8fTZQoUPaajm3CcmoYHDaFY3sFliVST21nNrIi1vfY5mGuxMLBezz+wgAk5Bp Zy1grauC0pjg5MrZt36h/uUMFqWAW6FfO/TomJMe5yCOvmouTp6weMEhPvIhtAPAOc Pm5c/6Yu9iipWrR41xGsBChz2qBf6Xsg9O5PqBrU= Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sakhmatd) with ESMTPSA id A7EA71C236E Date: Fri, 20 Jan 2017 17:42:21 -0500 From: Sergei Akhmatdinov 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: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/QxaReVH_R5qkw=d_kB7SSUJ"; protocol="application/pgp-signature" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jan 2017 22:42:25 -0000 --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 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--