diff options
author | Andy Lester <andy@petdance.com> | 2005-05-19 07:32:56 -0500 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2005-05-20 07:53:46 +0000 |
commit | 0dbb1585a715e56312e579a5f0e7f82241b38352 (patch) | |
tree | 7d159917164aa7ac921935b3fbff5b5d86aec0c7 /Porting | |
parent | 78b9063ba31cc2a48b78683b758601c04e4eb340 (diff) | |
download | perl-0dbb1585a715e56312e579a5f0e7f82241b38352.tar.gz |
Attribute configuration
Message-ID: <20050519173256.GA29039@petdance.com>
p4raw-id: //depot/perl@24508
Diffstat (limited to 'Porting')
-rw-r--r-- | Porting/Glossary | 40 | ||||
-rw-r--r-- | Porting/config.sh | 8 | ||||
-rw-r--r-- | Porting/pumpkin.pod | 39 |
3 files changed, 43 insertions, 44 deletions
diff --git a/Porting/Glossary b/Porting/Glossary index 41eec75fd9..99b8e34e7a 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -406,10 +406,42 @@ d_atoll (atoll.U): This variable conditionally defines the HAS_ATOLL symbol, which indicates to the C program that the atoll() routine is available. -d_attribut (d_attribut.U): - This variable conditionally defines HASATTRIBUTE, which - indicates the C compiler can check for function attributes, - such as printf formats. +d_attribute_format (d_attribut_format.U): + This variable conditionally defines HASATTRIBUTE_FORMAT, which + indicates the C compiler can check for printf-like formats. + +d_attribute_malloc (d_attribute_malloc.U): + This variable conditionally defines HASATTRIBUTE_MALLOC, which + indicates the C compiler can understand functions as having + malloc-like semantics. + +d_attribute_nonnull (d_attribute_nonnull.U): + This variable conditionally defines HASATTRIBUTE_NONNULL, which + indicates that the C compiler can know that certain arguments + must not be NULL, and will check accordingly at compile time. + +d_attribute_noreturn (d_attribute_noreturn.U): + This variable conditionally defines HASATTRIBUTE_NORETURN, which + indicates that the C compiler can know that certain functions + are guaranteed never to return. + +d_attribute_pure (d_attribute_pure.U): + This variable conditionally defines HASATTRIBUTE_PURE, which + indicates that the C compiler can know that certain functions + are "pure" functions, meaning that they have no side effects, and + only rely on function input and/or global data for their results. + +d_attribute_unused (d_attribute_unused.U): + This variable conditionally defines HASATTRIBUTE_UNUSED, which + indicates that the C compiler can know that certain variables + and arguments may not always be used, and to not throw warnings + if they don't get used. + +d_attribute_warn_unused_result (d_attribute_warn_unused_result.U): + This variable conditionally defines + HASATTRIBUTE_WARN_UNUSED_RESULT, which indicates that the C + compiler can know that certain functions have a return values + that must not be ignored, such as malloc() or open(). d_bcmp (d_bcmp.U): This variable conditionally defines the HAS_BCMP symbol if diff --git a/Porting/config.sh b/Porting/config.sh index 006c38db28..2b208fbedf 100644 --- a/Porting/config.sh +++ b/Porting/config.sh @@ -111,7 +111,13 @@ d_archlib='define' d_asctime_r='undef' d_atolf='undef' d_atoll='define' -d_attribut='define' +d_attribute_format='undef' +d_attribute_malloc='undef' +d_attribute_nonnull='undef' +d_attribute_noreturn='undef' +d_attribute_pure='undef' +d_attribute_unused='undef' +d_attribute_warn_unused_result='undef' d_bcmp='define' d_bcopy='define' d_bsd='undef' diff --git a/Porting/pumpkin.pod b/Porting/pumpkin.pod index ff1e5bd5f9..37e68f89ea 100644 --- a/Porting/pumpkin.pod +++ b/Porting/pumpkin.pod @@ -711,45 +711,6 @@ branches. =head2 Other tests -=over 4 - -=item CHECK_FORMAT - -If you have gcc, you can test the correct use of printf-style -arguments. Run C<Configure> with S<-Dccflags='-DCHECK_FORMAT --Wformat'> (and S<-Dcc=gcc>, if you are not on a system where C<cc> -is C<gcc>) and run C<make>. The compiler will produce warnings of -incorrect use of format arguments. - -As of change 23767, CHECK_FORMAT changes perl-defined formats -to obscure (but standard) formats, and then traps the obscure -format. The resulting perl executable operates properly but -you should not use the executable produced by this process. - -=over 4 - -=item * - -A more accurate approach is the following commands: - - make clean - make all OPTIMIZE='-DCHECK_FORMAT -Wformat' >& make.log - perl -nwe 'print if /^\S+:/ and not /^make\b/' make.log - -=item * - -A more thorough approach to compiler warnings is - - make clean - make miniperl OPTIMIZE=-O\ -DCHECK_FORMAT >& make.log - make all OPTIMIZE=-O\ -DCHECK_FORMAT\ -Wall\ -Wno-unused\ - -Wno-uninitialized >>& make.log - perl -nwe 'print if /^\S+:/ and not /^make\b/' make.log - -=back - -(-Wformat support by Robin Barker.) - =item gcc -ansi -pedantic Configure -Dgccansipedantic [ -Dcc=gcc ] will enable (via the cflags script, |