You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Rich Salz (JIRA)" <ji...@apache.org> on 2010/11/14 16:55:14 UTC

[jira] Created: (THRIFT-998) Silence g++ -Wswitch-enum warning in header

Silence g++ -Wswitch-enum warning in header
-------------------------------------------

                 Key: THRIFT-998
                 URL: https://issues.apache.org/jira/browse/THRIFT-998
             Project: Thrift
          Issue Type: Improvement
          Components: C++ - Library
            Reporter: Rich Salz


This small patch silence's G++ about -Wswitch-enum. I don't use switch-default as it gives too many false positives. Using break and a return outside the switch makes the code still work even if more enum's are added and the G++ warning isn't seen or is ignored.

This is related to the work started in THRIFT-916



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Created: (THRIFT-998) Silence g++ -Wswitch-enum warning in header

Posted by Christian Lavoie <ch...@gmail.com>.
What's the warning that g++ gives without this? And what g++/platform
version exactly?

On Sun, Nov 14, 2010 at 10:55 AM, Rich Salz (JIRA) <ji...@apache.org> wrote:
> Silence g++ -Wswitch-enum warning in header
> -------------------------------------------
>
>                 Key: THRIFT-998
>                 URL: https://issues.apache.org/jira/browse/THRIFT-998
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Rich Salz
>
>
> This small patch silence's G++ about -Wswitch-enum. I don't use switch-default as it gives too many false positives. Using break and a return outside the switch makes the code still work even if more enum's are added and the G++ warning isn't seen or is ignored.
>
> This is related to the work started in THRIFT-916
>
>
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>



-- 
Have fun, Christian
http://linkedin.christianlavoie.net

"I won't let you fall apart."

[jira] Assigned: (THRIFT-998) Silence g++ -Wswitch-enum warning in header

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier reassigned THRIFT-998:
----------------------------------

    Assignee: Roger Meier

> Silence g++ -Wswitch-enum warning in header
> -------------------------------------------
>
>                 Key: THRIFT-998
>                 URL: https://issues.apache.org/jira/browse/THRIFT-998
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Rich Salz
>            Assignee: Roger Meier
>         Attachments: diff.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> This small patch silence's G++ about -Wswitch-enum. I don't use switch-default as it gives too many false positives. Using break and a return outside the switch makes the code still work even if more enum's are added and the G++ warning isn't seen or is ignored.
> This is related to the work started in THRIFT-916

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (THRIFT-998) Silence g++ -Wswitch-enum warning in header

Posted by "Roger Meier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Roger Meier resolved THRIFT-998.
--------------------------------

    Resolution: Fixed

Rich, 
committed your patch. => minus 5 warnings

There are still 60 Warnings....
However -Wswitch (enabled via -Wall) should be sufficient for most cases.

> Silence g++ -Wswitch-enum warning in header
> -------------------------------------------
>
>                 Key: THRIFT-998
>                 URL: https://issues.apache.org/jira/browse/THRIFT-998
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Rich Salz
>            Assignee: Roger Meier
>         Attachments: diff.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> This small patch silence's G++ about -Wswitch-enum. I don't use switch-default as it gives too many false positives. Using break and a return outside the switch makes the code still work even if more enum's are added and the G++ warning isn't seen or is ignored.
> This is related to the work started in THRIFT-916

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (THRIFT-998) Silence g++ -Wswitch-enum warning in header

Posted by "Rich Salz (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-998?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Salz updated THRIFT-998:
-----------------------------

    Attachment: diff.txt

> Silence g++ -Wswitch-enum warning in header
> -------------------------------------------
>
>                 Key: THRIFT-998
>                 URL: https://issues.apache.org/jira/browse/THRIFT-998
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Rich Salz
>         Attachments: diff.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> This small patch silence's G++ about -Wswitch-enum. I don't use switch-default as it gives too many false positives. Using break and a return outside the switch makes the code still work even if more enum's are added and the G++ warning isn't seen or is ignored.
> This is related to the work started in THRIFT-916

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (THRIFT-998) Silence g++ -Wswitch-enum warning in header

Posted by "Rich Salz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-998?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12965562#action_12965562 ] 

Rich Salz commented on THRIFT-998:
----------------------------------

I might not have been clear enough.  This wasn't about making thrift pass more warnings, it's about the generated code and runtime -- stuff that ends up in "my project" :) -- passing through silently.

Thanks.


> Silence g++ -Wswitch-enum warning in header
> -------------------------------------------
>
>                 Key: THRIFT-998
>                 URL: https://issues.apache.org/jira/browse/THRIFT-998
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>            Reporter: Rich Salz
>            Assignee: Roger Meier
>         Attachments: diff.txt
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> This small patch silence's G++ about -Wswitch-enum. I don't use switch-default as it gives too many false positives. Using break and a return outside the switch makes the code still work even if more enum's are added and the G++ warning isn't seen or is ignored.
> This is related to the work started in THRIFT-916

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.