Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use anonymous namespace to avoid duplicate symbols #11265

Merged
merged 1 commit into from Sep 17, 2015

Conversation

wmtan
Copy link
Contributor

@wmtan wmtan commented Sep 15, 2015

This is a backport from 7_6_X #11066 and 7_5_X #11069 as requested by Slava Krutelyov
Bug fix. Totally technical.
In RecoEgamma/EgammaTools/plugins, there are free function templates in different files that have the same signature. These are violations of the ODR (one definition rule).
The reason this problem has not yet been seen before is that the function templates in question are declared "inline". However, "inline" is only a suggestion to the compiler. When compiled in debug mode (-O0), in-lining was apparently turned off. This did not cause a link error, as function templates are not instantiated until run time. However, it caused the wrong function to be called in several cases, causing relvals 4.53, 135.4, and 1330.0 to fail.
The fix is to put the templates inside an anonymous namespace, so each template is not seen outside the compilation unit. This fixes the failing relvals.

@Dr15Jones
Copy link
Contributor

please test

@cmsbuild cmsbuild added this to the Next CMSSW_7_4_X milestone Sep 15, 2015
@cmsbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @wmtan for CMSSW_7_4_X.

Use anonymous namespace to avoid duplicate symbols

It involves the following packages:

RecoEgamma/EgammaTools

@cmsbuild, @cvuosalo, @slava77 can you please review it and eventually sign? Thanks.
@Sam-Harper, @lgray this is something you requested to watch as well.
You can sign-off by replying to this message having '+1' in the first line of your reply.
You can reject by replying to this message having '-1' in the first line of your reply.
If you are a L2 or a release manager you can ask for tests by saying 'please test' in the first line of a comment.
@Degano you are the release manager for this.
You can merge this pull request by typing 'merge' in the first line of your comment.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

@slava77
Copy link
Contributor

slava77 commented Sep 16, 2015

+1

for #11265 88640e0

  • changes in the code are as described (anonymous namespace added)
  • jenkins tests pass and comparisons with baseline show no difference

... we have an overlapping edit in #11282 in RecoEgamma/EgammaTools/plugins/EGExtraInfoModifierFromDB.cc , but there is a separation in context of about 200 lines. So, both PRs should still merge independently.

@cmsbuild
Copy link
Contributor

This pull request is fully signed and it will be integrated in one of the next CMSSW_7_4_X IBs once checked with relvals in the development release cycle of CMSSW (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @Degano, @smuzaffar

@davidlange6
Copy link
Contributor

+1

cmsbuild added a commit that referenced this pull request Sep 17, 2015
Use anonymous namespace to avoid duplicate symbols
@cmsbuild cmsbuild merged commit 9808d9f into cms-sw:CMSSW_7_4_X Sep 17, 2015
@wmtan wmtan deleted the UseNamespace74x branch September 17, 2015 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants