Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#16213 closed defect (fixed)

Assertion failures in tests in propgrid sample

Reported by: ojwb Owned by: VZ
Priority: normal Milestone: 3.0.1
Component: samples Version: 3.0.0
Keywords: Cc:
Blocked By: Blocking:
Patch: no

Description

Originally reported at http://bugs.debian.org/746192


The attached patch fixes assertion failures with wx 3.0.0 with the propgrid sample when running the tests found under "Try These!" -> "Run Tests (fast)".

Suggesting for 3.0.1, as it's a simple and safe fix (just making the types passed match the %i formats in the format strings.

Attachments (1)

propgrid-assertion-fixes.patch download (3.5 KB) - added by ojwb 4 months ago.
proposed fix

Download all attachments as: .zip

Change History (5)

Changed 4 months ago by ojwb

proposed fix

comment:1 Changed 4 months ago by vadz

Thanks, I'm going to apply this to both branches.

If you (or anybody else) find more occurrences of this problem, I'd prefer to use unsigned for the variable type and %u for the format specifier rather than add casts if possible.

Thanks again!

comment:2 Changed 4 months ago by VZ

  • Owner set to VZ
  • Resolution set to fixed
  • Status changed from new to closed

In 76423:

Fix problems due to using "%i" format with size_t in propgrid sample.

Cast size_t value to int when passing it to "%i" format specifier as it has a
different size on LP64 platforms.

Closes #16213.

comment:3 Changed 4 months ago by VZ

In 76424:

Fix problems due to using "%i" format with size_t in propgrid sample.

Cast size_t value to int when passing it to "%i" format specifier as it has a
different size on LP64 platforms.

Closes #16213.

comment:4 Changed 4 months ago by ojwb

The narrowing casts seemed a bit ugly to me too, but I was just following what the existing code did in similar cases in the same source file.

Anyway, thanks for applying the patch.

Note: See TracTickets for help on using tickets.