#15971 closed defect (fixed)

ICC reports: declaration hides member

Reported by: ghostvoodooman Owned by:
Priority: lowest Milestone:
Component: GUI-all Version:
Keywords: icc trivial Cc:
Blocked By: Blocking:
Patch: yes

Description

Greetings,

1.

8>..\..\include\wx/msw/private/fswatcher.h(277): message #3280: declaration hides member "wxIOCPThread::wxEventProcessingData::watch" (declared at line 282)
8>                                  const wxFSWatchEntryMSW* watch) :
8>                                                           ^

2.

8>..\..\include\wx/msw/private/fswatcher.h(277): message #3280: declaration hides member "wxIOCPThread::wxEventProcessingData::watch" (declared at line 282)
8>                                  const wxFSWatchEntryMSW* watch) :
8>                                                           ^

3.

9>..\..\src\msw\app.cpp(643): message #3280: declaration hides member "wxAppConsoleBase::argc" (declared at line 451 of "..\..\include\wx/app.h")
9>    bool wxApp::Initialize(int& argc, wxChar **argv)
9>                                ^
9>  
9>..\..\src\msw\app.cpp(643): message #3280: declaration hides member "wxAppConsoleBase::argv" (declared at line 458 of "..\..\include\wx/app.h")
9>    bool wxApp::Initialize(int& argc, wxChar **argv)
9>                                               ^

4.

9>..\..\src\msw\ole\dataobj.cpp(243): message #3280: declaration hides member "wxIDataObject::SystemDataEntry::pformatetc" (declared at line 254)
9>            SystemDataEntry(FORMATETC *pformatetc, STGMEDIUM *pmedium)
9>                                       ^
9>  
9>..\..\src\msw\ole\dataobj.cpp(243): message #3280: declaration hides member "wxIDataObject::SystemDataEntry::pmedium" (declared at line 255)
9>            SystemDataEntry(FORMATETC *pformatetc, STGMEDIUM *pmedium)
9>                                                              ^

5.

12>..\..\src\generic\datavgen.cpp(3192): message #3280: declaration hides member "RowToTreeNodeJob::row" (declared at line 3237)
12>        RowToTreeNodeJob( unsigned int row , int current, wxDataViewTreeNode * node )
12>                                       ^
12>  
12>..\..\src\generic\datavgen.cpp(3192): message #3280: declaration hides member "RowToTreeNodeJob::current" (declared at line 3238)
12>        RowToTreeNodeJob( unsigned int row , int current, wxDataViewTreeNode * node )
12>                                                 ^

NB: my line numbers are shifted to +8 lines

I don't know whether this is a bug or (most probably) intended behaviour, though I think local function variables should have different names.

Attachments (5)

loclal_variables.pattch download (3.0 KB) - added by ghostvoodooman 10 months ago.
loclal_variables.patch download (2.9 KB) - added by ghostvoodooman 10 months ago.
loclal_variables.2.patch download (2.6 KB) - added by ghostvoodooman 10 months ago.
loclal_variables.3.patch download (2.1 KB) - added by ghostvoodooman 10 months ago.
local_variables.4.patch download (2.3 KB) - added by ghostvoodooman 10 months ago.

Download all attachments as: .zip

Change History (26)

comment:1 Changed 10 months ago by vadz

  • Keywords icc trivial added
  • Priority changed from low to lowest
  • Status changed from new to confirmed

I don't see any reason to believe this is a bug but we could rename the arguments. The standard convention we use for this case is to call them foo_, if they correspond to the member foo (if they don't correspond to it exactly, then some completely different name should be used).

If you want to submit a patch renaming them, please do.

comment:2 Changed 10 months ago by ghostvoodooman

If I make a patch, would you be comfortable with prefix "my_" ?

comment:3 Changed 10 months ago by vadz

Err, no?

We don't use this prefix anywhere, as I wrote, our convention is to use foo_.

comment:4 Changed 10 months ago by ghostvoodooman

Sorry, I was confused, as I understood prefix "foo_" literately. I think I will make patch with "my_" rather, since I thing "my_" prefix would be more self-explanatory than "foo_".

comment:5 Changed 10 months ago by ghostvoodooman

any opinion? and suggestion pls

comment:6 follow-up: Changed 10 months ago by neis

You still seem confused... Why rename parameters from watch to my_watch or argc to my_argc, when the convention used by wx is to rename them to watch_ or argc_? What's more self-explanatory about "my_"?

comment:7 in reply to: ↑ 6 Changed 10 months ago by ghostvoodooman

Replying to neis:

You still seem confused... Why rename parameters from watch to my_watch or argc to my_argc, when the convention used by wx is to rename them to watch_ or argc_? What's more self-explanatory about "my_"?

The problem is to eliminate ICC compiler warnings. Though the are negligible, I want to compile WX w/o warnings.

Changed 10 months ago by ghostvoodooman

comment:8 Changed 10 months ago by ghostvoodooman

The patch is attached

comment:9 Changed 10 months ago by ghostvoodooman

sorry for typo in file extension, my apologies

comment:10 Changed 10 months ago by vadz

I don't understand. Is this a joke?

You ask whether my_ prefix would be fine, two people reply that we'd prefer to use trailing underscore instead and you still make a patch using my_ prefix. Could you please explain why?

comment:11 Changed 10 months ago by ghostvoodooman

I'm sorry, in job I am working we have nomenclature/coding style that trailing underscore is prohibited, so there is to it. Attaching the new patch.

comment:12 Changed 10 months ago by ghostvoodooman

attaching a new patch (sorry, I was sleepy)

Changed 10 months ago by ghostvoodooman

Changed 10 months ago by ghostvoodooman

comment:13 follow-up: Changed 10 months ago by vadz

I don't want to be rude, but just how much time can this trivial change take?

Have you tried actually compiling the code after your changes? I'm pretty sure the code in src/msw/ole/dataobj.cpp can't compile after them...

comment:14 Changed 10 months ago by lanurmi

Also, the changes for src/generic/datavgen.cpp do not even fix both the reported warnings.

comment:15 Changed 10 months ago by ghostvoodooman

Sorry for long delay, I had things that were higher priority.

Is the "_" suffix comfortable?

comment:16 in reply to: ↑ 13 Changed 10 months ago by ghostvoodooman

Replying to vadz:

I don't want to be rude, but just how much time can this trivial change take?

Have you tried actually compiling the code after your changes? I'm pretty sure the code in src/msw/ole/dataobj.cpp can't compile after them...

I must admit that I Have not "clean" the project before recompilation, sry, my apologies.

comment:17 Changed 10 months ago by ghostvoodooman

  • Patch set

I am attaching patch loclal_variables.3.patch to resolve the issue, using '_' as a suffix.

Changed 10 months ago by ghostvoodooman

comment:18 Changed 10 months ago by ghostvoodooman

Sorry for spelling typo

comment:19 Changed 10 months ago by ghostvoodooman

Sorry, I fixed build error in local_variables.4.patch

comment:20 Changed 10 months ago by ghostvoodooman

Latest working patch replaced as local_variables.4.patch

Changed 10 months ago by ghostvoodooman

comment:21 Changed 10 months ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [76029]) Fix Intel compiler warnings about hiding member variables.

Rename method parameters to avoid conflicts with member variables names.

Closes #15971.

Note: See TracTickets for help on using tickets.