Re: gcc 4.9

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2 Aug 2016 02:04:13 +0000 (UTC)
"Amadeus W.M." <amadeus84@xxxxxxxxxxx> wrote:

[snip] 
> 
> That's what I thought too, but try this: 
> 
> // Compile as 
> // g++ -o gnuc gnuc.cpp                      
> // then as 
> // g++ --std=gnu++11 -o gnuc gnuc.cpp
> 
> #include <iostream>
> #include <cstdlib>
> 
> using namespace std;
> 
> int main(int argc, char * argv[])
> {
>     cout << __GNUC__ << "." << __GNUC_MINOR__ << endl;
>     return 0;
> }
> 
> 
> It always outputs 6.1, whether or not you compile it with the --std
> flag. And if you think about it, __GNUC__ is probably a macro defined
> in the compiler at compile time, so it can't possibly change at run
> time. Haven't checked, but it's a good guess.

Yes, that makes sense.  But I don't think it means that it hasn't
made the compile adhere to the different standard.

Using a later compiler on earlier code is not optimal, that's for
sure.  And you're right, it's hard to trust that any executable under
that circumstance is functioning correctly, since it could introduce
subtle bugs.  For example, firefox had some serious problems with gcc6
because it changed the way the compiler treated certain constructs of
C++ in the latest standard.  What had been perfectly valid code became
invalid under the new rules.
--
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux