* A few Qs on the -Wfoo options
@ 2013-11-20 19:48 ballsystemlord
2013-11-21 7:24 ` Ian Lance Taylor
2013-12-30 21:48 ` ballsystemlord
0 siblings, 2 replies; 6+ messages in thread
From: ballsystemlord @ 2013-11-20 19:48 UTC (permalink / raw)
To: gcc-help
-Wreal-q-constant What's a 'q' exponent-letter?
-Wline-truncation What is truncation of source lines?
-Winvalid-offsetof What/how do you offset of macro and how does this
affect anything?
-Wsurprising Could you explain what "suspicious" constructs
are/look like? What's the criteria?
-Wfunction-elimination shouldn't it be noticeable when I am making a
useless function call?
-Wimplicit-interface What's an implicit-interface?
-Wimplicit-procedure What's a procedures?
-Winvalid-memory-model atomic memory model?
-Warray-temporariesarray What temporaries?
-Wcharacter-truncation How can a character expression get truncated?
-Wcast-align Why's that a problem?
-Wcoverage-mismatch note this may result in poorly optimized code. Why
poorly??
-Wlogical-op Why would it give false positives? What's the criteria under
which it
makes these assumptions?
-Wmudflap mudflap?
-Wsuggest-attribute=[pure|const|noreturn]
const? pure? noreturn? How can functions be of this type?
-Wstack-protector how can a function get smashed?
--
View this message in context: http://gcc.1065356.n5.nabble.com/A-few-Qs-on-the-Wfoo-options-tp987688.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A few Qs on the -Wfoo options
2013-11-20 19:48 A few Qs on the -Wfoo options ballsystemlord
@ 2013-11-21 7:24 ` Ian Lance Taylor
2013-12-17 17:39 ` ballsystemlord
2013-12-17 17:43 ` ballsystemlord
2013-12-30 21:48 ` ballsystemlord
1 sibling, 2 replies; 6+ messages in thread
From: Ian Lance Taylor @ 2013-11-21 7:24 UTC (permalink / raw)
To: ballsystemlord; +Cc: gcc-help
On Wed, Nov 20, 2013 at 11:46 AM, ballsystemlord <doark@mail.com> wrote:
> -Wreal-q-constant What's a 'q' exponent-letter?
That is a Fortran option. Did you check the Fortran documentation?
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gfortran/Error-and-Warning-Options.html
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gfortran/_003ccode_003eQ_003c_002fcode_003e-exponent_002dletter.html
> -Wline-truncation What is truncation of source lines?
This is also a Fortran option and has to do with the way Fortran
works.
> -Winvalid-offsetof What/how do you offset of macro and how does this
> affect anything?
http://gcc.gnu.org/onlinedocs/gcc-4.8.2/gcc/Warning-Options.html
I'm not going to answer any of your questions. Please look at the
docs and come back if you still have questions.
Ian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A few Qs on the -Wfoo options
2013-11-21 7:24 ` Ian Lance Taylor
@ 2013-12-17 17:39 ` ballsystemlord
2013-12-17 17:43 ` ballsystemlord
1 sibling, 0 replies; 6+ messages in thread
From: ballsystemlord @ 2013-12-17 17:39 UTC (permalink / raw)
To: gcc-help
Ok, I've reread them. I could not find the definition of some of them because
they are only mentioned int the info manual under their '--no-'
counterparts, so when I searched for them with grep (because I did not
remember seeing them before because they were not there,) nothing came up.
I'm still interested in learning a little more about a few though.
-Wimplicit-interface What's an explicit interface?
-Wimplicit-procedure What's an explicit interface?
-Winvalid-memory-model I could not find it mentioned in the info
manual.
-Wcharacter-truncation "Warn when a character assignment will
truncate the assigned string." How can a string be truncated?
-Wlogical-op Why would it give false positives?
What's the criteria under which it makes these assumptions?
-Wstack-protector How can a function get smashed?
--
View this message in context: http://gcc.1065356.n5.nabble.com/A-few-Qs-on-the-Wfoo-options-tp987688p996338.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A few Qs on the -Wfoo options
2013-11-21 7:24 ` Ian Lance Taylor
2013-12-17 17:39 ` ballsystemlord
@ 2013-12-17 17:43 ` ballsystemlord
1 sibling, 0 replies; 6+ messages in thread
From: ballsystemlord @ 2013-12-17 17:43 UTC (permalink / raw)
To: gcc-help
Ok, I've reread the docs. I had not noticed some of the entry before because
I did not read the sections on FORTRAN and C++. I also greped to info manual
but most of the options only had documentation for there '--no-'
counterparts.
-Wline-truncation How can it be truncated?
-Wimplicit-interface What's an explicit interface?
-Wimplicit-procedure What's an explicit interface?
-Winvalid-memory-model I could not find it mentioned in the info
manual.
-Wcharacter-truncation "Warn when a character assignment will truncate
the assigned string." How/why would a string be truncated?
-Wlogical-op Why would it give false positives? What's the
criteria under which it makes these assumptions?
-Wstack-protector How can a function get smashed?
--
View this message in context: http://gcc.1065356.n5.nabble.com/A-few-Qs-on-the-Wfoo-options-tp987688p996340.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A few Qs on the -Wfoo options
2013-11-20 19:48 A few Qs on the -Wfoo options ballsystemlord
2013-11-21 7:24 ` Ian Lance Taylor
@ 2013-12-30 21:48 ` ballsystemlord
1 sibling, 0 replies; 6+ messages in thread
From: ballsystemlord @ 2013-12-30 21:48 UTC (permalink / raw)
To: gcc-help
Thanks, that clears it all up!
--
View this message in context: http://gcc.1065356.n5.nabble.com/A-few-Qs-on-the-Wfoo-options-tp987688p998755.html
Sent from the gcc - Help mailing list archive at Nabble.com.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: A few Qs on the -Wfoo options
[not found] <52B0FB85.3040604@gmail.com>
@ 2013-12-18 19:48 ` Ángel González
0 siblings, 0 replies; 6+ messages in thread
From: Ángel González @ 2013-12-18 19:48 UTC (permalink / raw)
To: gcc-help
On 17/12/13 18:43, ballsystemlord wrote:
> Ok, I've reread the docs. I had not noticed some of the entry before because
> I did not read the sections on FORTRAN and C++. I also greped to info manual
> but most of the options only had documentation for there '--no-'
> counterparts.
>
>
>
> -Wline-truncation How can it be truncated?
Code of Fortran programs is truncated at a number of characters. Everything
after col 72 is a comment (there are options to change this limit, see
-*ffixed-line-length*).
https://www.gnu.org/software/emacs/manual/html_node/emacs/Fortran-Columns.html
> -Wimplicit-interface What's an explicit interface?
One defined between 'interface' and 'end interface'? These are more
language questions than
compiler doubts (fortran, in this case)
> -Wimplicit-procedure What's an explicit interface?
> -Winvalid-memory-model I could not find it mentioned in the info
> manual.
Memory models are explained at
http://gcc.gnu.org/onlinedocs/gcc-4.7.1/gcc/_005f_005fatomic-Builtins.html
> -Wcharacter-truncation "Warn when a character assignment will truncate
> the assigned string." How/why would a string be truncated?
If you store into a variable able to store up to n characters data from
another variable which can hold up to m, with m > n.
> -Wlogical-op Why would it give false positives? What's the
> criteria under which it makes these assumptions?
It can give false positives if it's indeed what the author wanted. Note
how in this
option it is trying to outsmart the programmer by noticing that he intended
to do something different than what he stated.
A example warned by -Wlogical-op would be: «if (var > 1 || var < 5) {»
Since var (assumed to be an int variable) will always be greater than 1 or
less than 5, there's something fishy with that if.
> -Wstack-protector How can a function get smashed?
'-Wstack-protector'
This option is only active when '-fstack-protector' is active. (...)
So you go to:
'-fstack-protector'
Emit extra code to check for buffer overflows, such as stack
smashing attacks. This is done by adding a guard variable to
functions with vulnerable objects. This includes functions that
call 'alloca', and functions with buffers larger than 8 bytes. The
guards are initialized when a function is entered and then checked
when the function exits. If a guard check fails, an error message
is printed and the program exits.
So in two words: "Buffer overflows"
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-12-30 21:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-20 19:48 A few Qs on the -Wfoo options ballsystemlord
2013-11-21 7:24 ` Ian Lance Taylor
2013-12-17 17:39 ` ballsystemlord
2013-12-17 17:43 ` ballsystemlord
2013-12-30 21:48 ` ballsystemlord
[not found] <52B0FB85.3040604@gmail.com>
2013-12-18 19:48 ` Ángel González
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).