You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Steve Huston (JIRA)" <qp...@incubator.apache.org> on 2008/06/26 23:23:44 UTC

[jira] Created: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

managementgen/schema.py initializes unsigned value with -1
----------------------------------------------------------

                 Key: QPID-1153
                 URL: https://issues.apache.org/jira/browse/QPID-1153
             Project: Qpid
          Issue Type: Bug
          Components: Code Generator
    Affects Versions: M3
         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
            Reporter: Steve Huston
            Priority: Minor
         Attachments: qpid1153.diff

The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:

gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'

The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.


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


[jira] Commented: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Ted Ross (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617564#action_12617564 ] 

Ted Ross commented on QPID-1153:
--------------------------------

Two things:

1) Several lines in the patch are oddly truncated.  The patch can't be used without some manual fixups.
2) I claim the logic is still incorrect.  For example, if the minimum value ever goes to zero, the very next value will overwrite the minimum.

-Ted


> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: schema.py.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Resolved: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Ted Ross (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Ross resolved QPID-1153.
----------------------------

       Resolution: Fixed
    Fix Version/s: M3

Applied Steve's patch

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>             Fix For: M3
>
>         Attachments: schema.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Commented: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12617534#action_12617534 ] 

Steve Huston commented on QPID-1153:
------------------------------------

I attached a new patch that does:

- initialize min and max to their specified values (0, at this time)
- correctly set min on the first non-zero value seen
- rebased against current trunk version of schema.py

Please review and let me know if anything further is needed.
Thanks,
-Steve

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: schema.py.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Commented: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Ted Ross (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608914#action_12608914 ] 

Ted Ross commented on QPID-1153:
--------------------------------

This patch does squelch the compiler error but it also breaks the tracking of minimum values.  It causes the minimum value to always be reported as zero.

-1 was used to mean "the highest value representable by the type" since the types are unsigned.  Perhaps the logic should be changed such that when "Count" is zero, no inequality tests are done but both the Min and Max values are set to the first value.

-Ted


> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: qpid1153.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Assigned: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Ted Ross (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ted Ross reassigned QPID-1153:
------------------------------

    Assignee: Ted Ross

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: qpid1153.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Updated: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston updated QPID-1153:
-------------------------------

    Attachment:     (was: qpid1153.diff)

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: schema.py.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Updated: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston updated QPID-1153:
-------------------------------

    Attachment: qpid1153.diff

Patch that resolves the compile warning/error.

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Priority: Minor
>         Attachments: qpid1153.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Updated: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston updated QPID-1153:
-------------------------------

    Attachment:     (was: schema.py.diff)

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Updated: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston updated QPID-1153:
-------------------------------

    Attachment: schema.py.diff

Updated to both set initalization correctly and correctly update min value on first non-zero value.

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: schema.py.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Updated: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Huston updated QPID-1153:
-------------------------------

    Attachment: schema.diff

Right, thanks for that, Ted.
I've attached another patch file. This one should have the whole line lengths and also goes back to the original intent of setting min to the max possible value and max to the min possible value. However, it does this by using std::numeric_limits rather than -1 and 0.

-Steve

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: schema.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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


[jira] Commented: (QPID-1153) managementgen/schema.py initializes unsigned value with -1

Posted by "Steve Huston (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-1153?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12608937#action_12608937 ] 

Steve Huston commented on QPID-1153:
------------------------------------

Yes, changing the init value necessitates a change in understanding - I think your suggestion for the logic is good.

Init to 0 is what the spec says... maybe the spec needs a change, or a comment that 0 means nothing?

-Steve

> managementgen/schema.py initializes unsigned value with -1
> ----------------------------------------------------------
>
>                 Key: QPID-1153
>                 URL: https://issues.apache.org/jira/browse/QPID-1153
>             Project: Qpid
>          Issue Type: Bug
>          Components: Code Generator
>    Affects Versions: M3
>         Environment: Red Hat Enterprise Linux 4, g++ 3.4.6
>            Reporter: Steve Huston
>            Assignee: Ted Ross
>            Priority: Minor
>         Attachments: qpid1153.diff
>
>
> The cpp/managementgen/schema.py script generates gen/qpid/management/Queue.cpp that causes compile warnings which are promoted to errors by the build settings. The warnings are:
> gen/qpid/management/Queue.cpp: In constructor `qpid::management::Queue::Queue(qpid::management::Manageable*, qpid::management::Manageable*, std::string, uint8_t, uint8_t, uint8_t)':
> gen/qpid/management/Queue.cpp:80: warning: converting of negative value `-0x000000001' to `uint64_t'
> gen/qpid/management/Queue.cpp: In member function `virtual void qpid::management::Queue::writeStatistics(qpid::framing::Buffer&, bool)':
> gen/qpid/management/Queue.cpp:527: warning: converting of negative value `-0x000000001' to `uint64_t'
> The attached patch resolves the warnings by initializing using the value set in the spec. At this time, that turns out to be 0.

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