From owner-freebsd-current@freebsd.org Fri Apr 6 06:22:22 2018 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D40F85E93 for ; Fri, 6 Apr 2018 06:22:22 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5582D87862; Fri, 6 Apr 2018 06:22:22 +0000 (UTC) (envelope-from sgk@troutmask.apl.washington.edu) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id w366MKdE045600 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 5 Apr 2018 23:22:20 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id w366MKE3045599; Thu, 5 Apr 2018 23:22:20 -0700 (PDT) (envelope-from sgk) Date: Thu, 5 Apr 2018 23:22:20 -0700 From: Steve Kargl To: David Chisnall Cc: Pete Wright , Conrad Meyer , freebsd-current Subject: Re: clang manual page? Message-ID: <20180406062219.GA45545@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20180405223852.GA43120@troutmask.apl.washington.edu> <20180406001514.GA43793@troutmask.apl.washington.edu> <347cc907-96b3-140d-5a8f-084f91283be5@nomadlogic.org> <6691B42A-E56F-4432-82FA-42BC410EC152@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6691B42A-E56F-4432-82FA-42BC410EC152@FreeBSD.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Apr 2018 06:22:23 -0000 On Fri, Apr 06, 2018 at 06:20:41AM +0100, David Chisnall wrote: > On 6 Apr 2018, at 01:30, Pete Wright wrote: > > > > > > On 04/05/2018 17:15, Steve Kargl wrote: > >> This assumes that a gcc(1) is available on the system. > >> > >> % man gcc > >> No manual entry for gcc > >> > >> If the system compiler is clang/clang++, then it ought to be > >> documented better than it currently is. Ian's suggests for > >> 'clang --help' is even worse > >> > >> % clang --help | grep -- -std > >> -cl-std= OpenCL language standard to compile for. > >> -std= Language standard to compile for > >> -stdlib= C++ standard library to use > >> > >> Does == ? > >> > > a quick google search turns up the following additional information: > > > > "clang supports the -std option, which changes what language mode clang uses. The supported modes for C are c89, gnu89, c99, gnu99, c11, gnu11, c17, gnu17, and various aliases for those modes. If no -std option is specified, clang defaults to gnu11 mode. Many C99 and C11 features are supported in earlier modes as a conforming extension, with a warning. Use |-pedantic-errors| to request an error if a feature from a later standard revision is used in an earlier mode." > > > > https://clang.llvm.org/docs/UsersManual.html > > I believe that the clang user manual referenced here is written in Sphynx, which is able to generate mandoc output as well as HTML. Perhaps we should incorporate the generated file in the next import? > > David That would be a good start. But, after cruisng around the clang webpages, there is no clear set of for -std= in the User's manuals on the webpages. For example, "clang -std=iso9899:1990" apparently is valid, but google find no instances of this construct. A search of clang.llvm.org does not find this construct. Surprising doing something complete stupid give` % cc -std=fubar -c a.c error: invalid value 'fubar' in '-std=fubar' note: use 'c89', 'c90', or 'iso9899:1990' for 'ISO C 1990' standard note: use 'iso9899:199409' for 'ISO C 1990 with amendment 1' standard note: use 'gnu89' or 'gnu90' for 'ISO C 1990 with GNU extensions' standard note: use 'c99' or 'iso9899:1999' for 'ISO C 1999' standard note: use 'gnu99' for 'ISO C 1999 with GNU extensions' standard note: use 'c11' or 'iso9899:2011' for 'ISO C 2011' standard note: use 'gnu11' for 'ISO C 2011 with GNU extensions' standard note: use 'c17' or 'iso9899:2017' for 'ISO C 2017' standard note: use 'gnu17' for 'ISO C 2017 with GNU extensions' standard % clang++ -std=fubar a.cxx error: invalid value 'fubar' in '-std=fubar' note: use 'c++98' or 'c++03' for 'ISO C++ 1998 with amendments' standard note: use 'gnu++98' or 'gnu++03' for 'ISO C++ 1998 with amendments and GNU extensions' standard note: use 'c++11' for 'ISO C++ 2011 with amendments' standard note: use 'gnu++11' for 'ISO C++ 2011 with amendments and GNU extensions' standard note: use 'c++14' for 'ISO C++ 2014 with amendments' standard note: use 'gnu++14' for 'ISO C++ 2014 with amendments and GNU extensions' standard note: use 'c++17' for 'ISO C++ 2017 with amendments' standard note: use 'gnu++17' for 'ISO C++ 2017 with amendments and GNU extensions' standard note: use 'c++2a' for 'Working draft for ISO C++ 2020' standard note: use 'gnu++2a' for 'Working draft for ISO C++ 2020 with GNU extensions' standard This information belongs in a manpage. -- Steve