utzig commented on a change in pull request #195: Allow build_profile to be 
overridden per package
URL: https://github.com/apache/mynewt-newt/pull/195#discussion_r206495333
 
 

 ##########
 File path: newt/toolchain/compiler.go
 ##########
 @@ -159,6 +159,15 @@ func NewCompilerInfo() *CompilerInfo {
 // Extracts the base of a flag string.  A flag base is used when detecting flag
 // conflicts.  If two flags have identicial bases, then they are in conflict.
 func flagsBase(cflags string) string {
+       // "-O" (optimization level) is one possible flag base.  By singling 
these
+       // out, newt can prevent the original optimization flag from being
+       // overwritten by subsequent ones.
+       if len(cflags) == 3 && strings.HasPrefix(cflags, "-O") {
 
 Review comment:
   What if someone passes the flag `-O` (which is equivalent to `-O1`)?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to