Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2014 17:37:15 -0800
From:      Charles Swiger <cswiger@mac.com>
To:        Joe Nosay <superbisquit@gmail.com>
Cc:        ports <ports@freebsd.org>
Subject:   Re: CLang flags query:: I'm wanting to port software to FreeBSD
Message-ID:  <CC59A8DB-6D27-4712-ABE5-0C1DF2221B2B@mac.com>
In-Reply-To: <CA%2BWntOufYoHVT7kpGasMNwnTYNWvaidf4z7Pv8mhaOOJWWfAeA@mail.gmail.com>
References:  <CA%2BWntOufYoHVT7kpGasMNwnTYNWvaidf4z7Pv8mhaOOJWWfAeA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi--

On Feb 26, 2014, at 3:43 PM, Joe Nosay <superbisquit@gmail.com> wrote:
> I've noticed different flags such as -Wno-parentheses and such along with
> the -Wno-unused-variable. I would like to know where would be a good source
> online to find the flags;

For compatibility, clang understands the commonly used -W flags that gcc uses.
More documentation is here:

   http://clang.llvm.org/docs/UsersManual.html

...and normally folks use -Wall, -Wpedantic, or -Weverything.  However, if you truly
want the complete list, run clang's "diagtool list-warnings":

% clang/Debug+Asserts/bin/diagtool list-warnings
Warnings with flags (924):
  backslash_newline_space [-Wbackslash-newline-escape]
  escaped_newline_block_comment_end [-Wcomment]
  ext_abstract_pack_declarator_parens [-Wanonymous-pack-parens]
  ext_aggregate_init_not_constant [-Wc99-extensions]
[ ... ]
  warn_zero_size_struct_union_in_extern_c [-Wextern-c-compat]
Warnings without flags (111):
  ext_delete_void_ptr_operand
[ ... ]
  warn_weak_identifier_undeclared
  warn_weak_import

STATISTICS:

  Percentage of warnings with flags: 89.28%
  Number of unique flags: 394
  Average number of diagnostics per flag: 2.345
  Number in -Wpedantic (not covered by other -W flags): 28

> and, I would like to know what flags are used by porters to optimize builds.

The default CFLAGS should be respected, unless a port needs something in particular
in order to work; see:

http://www.freebsd.org/doc/en/books/porters-handbook/dads-cflags.html

> These will be placed on the Makefile of the source such that it can be built natively
> on FreeBSD. I would be able to test software.

Good luck; and note that the entire porter's handbook is worth a read.  :-)

Regards,
-- 
-Chuck





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CC59A8DB-6D27-4712-ABE5-0C1DF2221B2B>