Re:Re: Local class name conflict
Resend for easy reading. Thanks! On 2018-01-16 14:45, Andrew Pinski wrote: > On Mon, Jan 15, 2018 at 10:35 PM, chenzhelu wrote: >> Hello all, >> I encountered a problem on "local class name conflict", >> I searched on net and found that years ago, some people also encoutered this >> kind of problem. > > The correct name for this is One Definition Rule (or ODR for short). > Basically a violation of this rule causes the code to be invalid (with > no diagnostic required; therefor undefined code). If you use LTO, GCC > sometimes will warn about this violation. Thanks for suggestion! Yes, this test code is intent to create local classes with same name, for a small project, it's easy to find out this error, consider a big project... The root cause is, it's possible that two local classes with same name in a namespace, (or the default anonymous namespace), I know that it violate with ODR, however, the point is, it seems that compiler is somehow not consistent in the Compile and Link phase, that's what I confused of. > > If you want a truly local class, then use anonymous namespaces which > is designed to fix this issue. This will rely on human to keep local class name unique within a namspace, or the default anonymous namespace. consider a project with hundreds of files. As a precise software, I think it'd better not allow this undefined behavior open, whether the compile better give some warning/error on this name conflicts, or link with the "nearest" local class ? Thanks! > > Thanks, > Andrew > >> >> https://stackoverflow.com/questions/10671956/same-class-name-in-different-c-files >> http://www.cplusplus.com/forum/general/32010/ >> >> >> Please see the following code, (BTW, it seems that the maillist can not >> attach files) >> >> When I ran the code(Ubuntu 64bis, gcc vesion:5.4.0, the amazing result is : >> localClassXInData.cpp in Data.cpp >> localClassXInData.cpp in Data.cpp >> >> >> I think there is an error in Link phrase: >> 1. if comment out the LocalClassX definition in main.cpp, the compile will >> not compile the code --- this is as expected. >> 2. however, if run the code(not comment out any code), the code actually ran >> is in the Data.cpp, that is not consistent with compile phase. >> >> >> Thanks!
Re:Re: Local class name conflict
On 2018-01-16 14:45, Andrew Pinski wrote: > On Mon, Jan 15, 2018 at 10:35 PM, chenzhelu wrote: >> Hello all, >> I encountered a problem on "local class name conflict", >> I searched on net and found that years ago, some people also encoutered this >> kind of problem. > > The correct name for this is One Definition Rule (or ODR for short). > Basically a violation of this rule causes the code to be invalid (with > no diagnostic required; therefor undefined code). If you use LTO, GCC > sometimes will warn about this violation. > > If you want a truly local class, then use anonymous namespaces which > is designed to fix this issue. After I tried the anonymous namespace, it really solve this! namspace { class LocalClassX { . }; } In before, I took for granted that the default "empty namespace" is same with "anonymous namespace", they are different. C++ is really complex, I never use anonymouse namespace bofore. Thanks a lot!
Re: GCC 8.0.0 Status Report (2018-01-15), Trunk in Regression and Documentation fixes only mode
On Mon, Jan 15, 2018 at 09:21:07AM +0100, Richard Biener wrote: > We're still in pretty bad shape regression-wise. Please also take > the opportunity to check the state of your favorite host/target > combination to make sure building and testing works appropriately. I tested building Linux (the kernel) for all supported architectures. Everything builds (with my usual tweaks, link with libgcc etc.); except x86_64 and sh have more problems in the kernel, and mips has an ICE. I'll open a PR for that one. Segher
Re: GCC 8.0.0 Status Report (2018-01-15), Trunk in Regression and Documentation fixes only mode
On Tue, 16 Jan 2018, Segher Boessenkool wrote: > On Mon, Jan 15, 2018 at 09:21:07AM +0100, Richard Biener wrote: > > We're still in pretty bad shape regression-wise. Please also take > > the opportunity to check the state of your favorite host/target > > combination to make sure building and testing works appropriately. > > I tested building Linux (the kernel) for all supported architectures. > Everything builds (with my usual tweaks, link with libgcc etc.); > except x86_64 and sh have more problems in the kernel, and mips has > an ICE. I'll open a PR for that one. And all glibc architectures compile (and compile the testsuite) OK except for the sh4eb ICE reported in bug 83760 (and the longstanding coldfire issue, bug 68467). -- Joseph S. Myers jos...@codesourcery.com
Re: Copyright assignment form
On 01/15/2018 03:11 PM, Shahid Khan wrote: Our team at Qualcomm Datacenter Technologies, Inc. is interested in contributing patches to the upstream GCC compiler project. To get the process started, we'd like to request a copyright assignment form as per contribution guidelines outlined at https://gcc.gnu.org/contribute.html. Please let me know if there are additional steps we need to take to become an effective contributor to the GCC community. You should contact ass...@gnu.org directly. The standard forms contain language about patents that Qualcomm lawyers are unlikely to be comfortable with, and may require negotiating a non-standard agreement. As best as I can tell, the FSF has never received a copyright assignment or disclaimer from Qualcomm. If this is the first time Qualcomm lawyers are talking to the FSF, this will take a while. I would not be surprised if this takes a year or two. You will also need a VP level signature for the forms once you get approval from Qualcomm lawyers. You may want to consider getting a disclaimer from your employer, and then filing personal assignments. It is probably easier to get a disclaimer from Qualcomm than an assignment, but this requires more paperwork, since each individual contributing then needs their own personal assignment. The disclaimers also have language about patents that the Qualcomm lawyers may not like, so while this should be easier, it is still likely a difficult process. Siddhesh can help you with this as the rules for gcc are the same as for glibc. Jim
Re: GCC 8.0.0 Status Report (2018-01-15), Trunk in Regression and Documentation fixes only mode
Boot strap on Darwin x86_64 with llvm now seems broken as of last 8.0.0 snapshot, it still is working fine with 7.2.0. I've added bug: 83903 x86_64, armv6, armv7, aarch64 all seem fine on linux. I've been building with latest gmp (6.1.2), mpfr (4.0.0) and mpc (1.1.) across all my systems. I observe isl was updated to 0.18 in the download_prerequisites script. Are the other's going to get updated before the 8.0.0 release?
RE: Copyright assignment form
Thanks for the info, Jim. Siddhesh, Is there a separate copyright assignment for glibc or the same form works for both? -Shahid -Original Message- From: Jim Wilson [mailto:j...@sifive.com] Sent: Tuesday, January 16, 2018 1:01 PM To: Shahid Khan ; gcc@gcc.gnu.org Cc: siddh...@linaro.org Subject: Re: Copyright assignment form On 01/15/2018 03:11 PM, Shahid Khan wrote: > Our team at Qualcomm Datacenter Technologies, Inc. is interested in > contributing patches to the upstream GCC compiler project. To get the process > started, we'd like to request a copyright assignment form as per contribution > guidelines outlined at https://gcc.gnu.org/contribute.html. > > Please let me know if there are additional steps we need to take to become an > effective contributor to the GCC community. You should contact ass...@gnu.org directly. The standard forms contain language about patents that Qualcomm lawyers are unlikely to be comfortable with, and may require negotiating a non-standard agreement. As best as I can tell, the FSF has never received a copyright assignment or disclaimer from Qualcomm. If this is the first time Qualcomm lawyers are talking to the FSF, this will take a while. I would not be surprised if this takes a year or two. You will also need a VP level signature for the forms once you get approval from Qualcomm lawyers. You may want to consider getting a disclaimer from your employer, and then filing personal assignments. It is probably easier to get a disclaimer from Qualcomm than an assignment, but this requires more paperwork, since each individual contributing then needs their own personal assignment. The disclaimers also have language about patents that the Qualcomm lawyers may not like, so while this should be easier, it is still likely a difficult process. Siddhesh can help you with this as the rules for gcc are the same as for glibc. Jim
RE: Copyright assignment form
Hi Shahid, You need a separate assignment for every GNU project you intend to contribute to, so separate assignments for GCC, glibc, binutils, etc. Siddhesh On 17-Jan-2018 01:25, "Shahid Khan" wrote: Thanks for the info, Jim. Siddhesh, Is there a separate copyright assignment for glibc or the same form works for both? -Shahid -Original Message- From: Jim Wilson [mailto:j...@sifive.com] Sent: Tuesday, January 16, 2018 1:01 PM To: Shahid Khan ; gcc@gcc.gnu.org Cc: siddh...@linaro.org Subject: Re: Copyright assignment form On 01/15/2018 03:11 PM, Shahid Khan wrote: > Our team at Qualcomm Datacenter Technologies, Inc. is interested in contributing patches to the upstream GCC compiler project. To get the process started, we'd like to request a copyright assignment form as per contribution guidelines outlined at https://gcc.gnu.org/contribute.html. > > Please let me know if there are additional steps we need to take to become an effective contributor to the GCC community. You should contact ass...@gnu.org directly. The standard forms contain language about patents that Qualcomm lawyers are unlikely to be comfortable with, and may require negotiating a non-standard agreement. As best as I can tell, the FSF has never received a copyright assignment or disclaimer from Qualcomm. If this is the first time Qualcomm lawyers are talking to the FSF, this will take a while. I would not be surprised if this takes a year or two. You will also need a VP level signature for the forms once you get approval from Qualcomm lawyers. You may want to consider getting a disclaimer from your employer, and then filing personal assignments. It is probably easier to get a disclaimer from Qualcomm than an assignment, but this requires more paperwork, since each individual contributing then needs their own personal assignment. The disclaimers also have language about patents that the Qualcomm lawyers may not like, so while this should be easier, it is still likely a difficult process. Siddhesh can help you with this as the rules for gcc are the same as for glibc. Jim
Re: Copyright assignment form
On Tue, Jan 16, 2018 at 12:01 PM, Siddhesh Poyarekar wrote: > You need a separate assignment for every GNU project you intend to > contribute to, so separate assignments for GCC, glibc, binutils, etc. The form is the same for all GNU projects. You can file an assignment that covers a single patch, or a single project, or multiple patches, or multiple projects, or even all patches for all projects. Though of course the lawyers will have a say in this, as they may not be comfortable with a broad assignment, and may want to restrict it to specific projects, or even specific patches for specific projects. The more restricted the assignment, the more paperwork you have to do, but the easier it it to get it past lawyers uncomfortable with FSF requirements. For instance, you can get an assignment for a single patch, but then you have to go through the assignment process every time you contribute a patch. Jim
Re: Copyright assignment form
On 17-Jan-2018 02:02, "Jim Wilson" wrote: On Tue, Jan 16, 2018 at 12:01 PM, Siddhesh Poyarekar wrote: > You need a separate assignment for every GNU project you intend to > contribute to, so separate assignments for GCC, glibc, binutils, etc. The form is the same for all GNU projects. Right, the content is the same, but I remember signing separate papers for each project. Siddhesh
Re: Copyright assignment form
On Tue, 16 Jan 2018, Jim Wilson wrote: > You should contact ass...@gnu.org directly. The standard forms contain > language about patents that Qualcomm lawyers are unlikely to be comfortable > with, and may require negotiating a non-standard agreement. As best as I can > tell, the FSF has never received a copyright assignment or disclaimer from > Qualcomm. Which is why the Hexagon ports of GCC / binutils / GDB / glibc never went upstream. -- Joseph S. Myers jos...@codesourcery.com
Re: Copyright assignment form
On Tue, 16 Jan 2018, Jim Wilson wrote: > You can file an assignment that covers a single patch, or a single > project, or multiple patches, or multiple projects, or even all > patches for all projects. Though of course the lawyers will have a > say in this, as they may not be comfortable with a broad assignment, > and may want to restrict it to specific projects, or even specific > patches for specific projects. The more restricted the assignment, And it may be restricted in which staff can contribute patches (either describing a group of staff, or listing names and requiring additional paperwork to add extra individuals to it). -- Joseph S. Myers jos...@codesourcery.com