This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Wmissing-parameter-type (PR7651 Define -Wextra strictly in terms of other warning flags)


On 19 Dec 2006 21:08:30 -0500, DJ Delorie <dj@redhat.com> wrote:

"Manuel LÃpez-IbÃÃez" <lopezibanez@gmail.com> writes: > I would say that it is not a new warning but...whatever, OK, I > withdraw the patch and I will resubmit with its corresponding new > testcases.

It's not a new warning, but it is a new *option*.  You'll need test
cases that test various cases:

1. No option specified
2. Option on (warn), option off (no warn)
3. Option on, marked as an error, marked as a warning overriding -Werror

Really? I was thinking about just 1. and the first part of 2 which is what I have seen in the testsuite. I don't want to sound pretentious so, please, believe when I saying that I am asking this sincerely: are those 3 points a requirement I have overlooked or is it a mere suggestion? I am a newbie, so I could have easily missed a testcase that implements point 3.

On the other hand, if this is how new warning options should be
tested, wouldn't it be appropriate to have some kind of automatic
mechanism that applies the different combinations over the same
testcase adjusting the expected output accordingly?

It's the command line processing that you're testing, not just the
code that recognizes the warning in the code.

If that is the goal, I think some mechanism as proposed above will help a lot. That is, a testcase with a special dg-command like { dg-do testwarn } { dg-options "-Wmywarning" }. So it tests for the warnings (the testcase includes the corresponding dg-warning directives), it also tests that nothing happens without the option and when using Wno-mywarning (dg-warning directives are converted to dg-bogus), it can also test for warnings converted to errors and such.

Well, perhaps I am just dreaming since I have no idea how or if this
could be implemented in dejagnu.

Cheers,
Manuel.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]