PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, April 27, 2022

[FIXED] What is this 'bad:' label generated by Cython?

 April 27, 2022     c++, compilation, cython, python, warnings     No comments   

Issue

While cythonizing my Cython source code files, I can see a dozen of warnings about a label named 'bad:' generated by Cython, for example:

read_input.cpp:30037:3: warning: label ‘bad’ defined but not used [-Wunused-label]

The C++ generated function is like this:

static PyObject* __pyx_convert__to_py_struct__VehicleCaps(struct VehicleCaps s) {
  PyObject* res;
  PyObject* member;
  res = __Pyx_PyDict_NewPresized(0); if (unlikely(!res)) return NULL;
  return res;
  bad:
  Py_XDECREF(member);
  Py_DECREF(res);
  return NULL;
}

The 'bad:' label is in there, I don't get it why Cython is generating this unused label and it shows warnings.

Do I have really fix these warnings? or it's safe to leave them untouched?


Solution

It's for goto bad if something fails in the function, but it doesn't look like anything can fail, so it's unused.

It isn't a problem so you can ignore it. But Cython generally tries not to generate unused labels, so feel free to report it as a (small) bug



Answered By - DavidW
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing