Remove compiler option?

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do I remove a compiler option?  I think I knew how to do it at one time.  I am using AS 6.2.

 

 

 

Last Edited: Sat. Apr 9, 2016 - 11:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The screen shot above shows the "abridged" options in read-only mode. They are changed in the tree nodes below "AVR/GNU C++ Compiler".

 

What option do you want to change?

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to remove -fshort-enums to see if that makes a weird warning message go away.  I don't see that option in any of the tree nodes.

 

While on that subject, I'm trying to make my code portable between gcc and Microsoft's compiler without having to use #ifdef _WIN32 whenever I use enums where size matters.  Microsoft doesn't have the -fshort-enums option, as far as I know.  I use the newfangled method like this:


#if defined(_WIN32)
   enum   Events : unsigned char  {
#else
// enum   Events  {
   enum   Events : unsigned char  {
#endif
      None = 0,
      };

 

I think the newfangled method works for gcc too, but I get this warning:

Warning 1 scoped enums only available with -std=c++11 or -std=gnu++11 [enabled by default] 

I've heard of scoped enums but I don't know what they are and hopefully I don't need to know. 

I'm using gcc version 4.6.2 (AVR_8_bit_GNU_Toolchain_3.4.0_663)

Last Edited: Sun. Apr 10, 2016 - 11:14 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

:: Morten

 

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

 

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Morten.   I wasn't looking very hard. 

 

I tried unchecking that, but the warnings remain.  I sort of though that would be the case, but I wanted to make sure.  Actually this is a good thing.  Removing -fshort-enums would probably cause code bloat on the 8 bit AVRs.

 

I will now do a google search for scoped enums.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17 wrote:
but I get this warning:
then why don't you do what it says? I think you'll find the AS7 project default is probably -std=gnu99. Change that to -std=gnu++11 and you can start to use features from the 2011 standard (and the GNU extensions to it). 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

then why don't you do what it says? I think you'll find the AS7 project default is probably -std=gnu99. Change that to -std=gnu++11 and you can start to use features from the 2011 standard (and the GNU extensions to it). 

Well you have a point.  I could argue about what it says, but yes, you could infer that.  So I tried it.  I don't think there is any -std present normally.  I put the gnu++11 thing in the Miscellaneous category.  That did eliminate the warnings but it also gave me 28 errors.

 

This looks like deja vu all over again.  I've fought this battle in the past and somehow overcome it.  Gcc sometimes goes ballistic and acts irrationally when I tell it to copy volatiles.  I'm thinking this is likely a bug in gcc.  The error messages don't make any sense to me.  Microsoft's compiler thinks my code is fine.

 

I will try to make a simple project that pokes the hornet's nest.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17 wrote:
I'm thinking this is likely a bug in gcc.

OK so let's see the smallest test program that demonstrates this assertion.

steve17 wrote:
Microsoft's compiler thinks my code is fine.
Odd, I almost always find the opposite! Not least of which is because Microsoft's brain dead compiler does not support C99 :-(

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since Microsofts compiler always (?) has had Windows applications as it's prime target, and since the object-oriented C++ Windows app framework MFC (Microsoft Foundation Classes) surfaced already 1995 it just might be that they have been more active with their C++ compiler than with their C compiler. Add to the picture that one of the persons in the absolute inner circle of C++ persons is Herb Sutter (working at Microsoftlast time I looked) and MS devotion to C++ rather than C might be better explained.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Mon. Apr 11, 2016 - 01:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:

steve17 wrote:I'm thinking this is likely a bug in gcc.

OK so let's see the smallest test program that demonstrates this assertion.

Should I post it here or in the Compilers forum?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

steve17 wrote:
or in the Compilers forum?
That.