Skip to content

Tkinter: return value of mp_init() should not be ignored #106350

Closed

Description

@chrstphrchvz

An mp_int structure is usable only if mp_init() returns MP_OKAY; mp_init() may return MP_MEM if it fails to allocate memory (see https://github.com/libtom/libtommath/blob/v1.2.0/bn_mp_init.c#L12).

mp_init() must be checked to avoid a warning when compiling against standalone libtommath headers (rather than Tcl-bundled libtommath):

./Modules/_tkinter.c:908:5: warning: ignoring return value of function declared with 'warn_unused_result' attribute [-Wunused-result]
    mp_init(&bigValue);
    ^~~~~~~ ~~~~~~~~~
1 warning generated.

Linked PRs

Activity

  1. added a commit that references this issue on Jul 3, 2023
  2. added
    type-bugAn unexpected behavior, bug, or error
    stdlibStandard Library Python modules in the Lib/ directory
    on Jul 3, 2023
  3. added a commit that references this issue on Jul 25, 2023
  4. added 2 commits that reference this issue on Jul 25, 2023
  5. added 2 commits that reference this issue on Jul 26, 2023
  6. added a commit that references this issue on Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-tkintertype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions