HN user

msim

19 karma
Posts1
Comments8
View on HN

Location: Sweden

Remote: Yes

Willing to relocate: Maybe

Technologies: C++, PHP, JavaScript, SQL

Résumé/CV: Available upon request.

Email: hn@mikaelsimonsson.com

GitHub: https://github.com/msimonsson

Software developer with 7+ years of modern C++ experience and 10+ years of PHP experience. Available for freelancing/consulting as well as full time salaried work.

Location: Sweden

Remote: Yes

Willing to relocate: Maybe

Technologies: C++, PHP, JavaScript, SQL

Résumé/CV: Available upon request.

Email: hn@mikaelsimonsson.com

GitHub: https://github.com/msimonsson

Software developer with 7+ years of modern C++ experience and 10+ years of PHP experience. Available for freelancing/consulting as well as full time salaried work.

This. The UTF-8 decoding is broken, and I didn't look at anything beyond that, resulting in a heap buffer overflow with untrusted input.

And here is a summary of the warnings I get when compiling with "-Weverything":

   26 [-Wcast-align]
   20 [-Wcast-qual]
    6 [-Wconditional-uninitialized]
   24 [-Wdollar-in-identifier-extension]
  172 [-Wold-style-cast]
    2 [-Wshorten-64-to-32]
    3 [-Wsign-compare]
   25 [-Wsign-conversion]
    3 [-Wunused-parameter]
   72 [-Wzero-as-null-pointer-constant]
Please don't use this code.

It's code like this that gives C++ a bad reputation. It's not modern in any sense. Compiling it with my default warning level in clang gives 482 warnings! Here's a summary:

  warning: cast from '...' to '...' increases required alignment from 1 to X [-Wcast-align]
  warning: declaration shadows a field of '...' [-Wshadow]
  warning: declaration shadows a local variable [-Wshadow]
  warning: implicit conversion changes signedness: '...' to '...' [-Wsign-conversion]
  warning: implicit conversion loses integer precision: '...' to '...' [-Wconversion]
  warning: implicit conversion loses integer precision: '...' to '...' [-Wshorten-64-to-32]
  warning: macro name is a reserved identifier [-Wreserved-id-macro]
  warning: no previous prototype for function '...' [-Wmissing-prototypes]
  warning: operand of ? changes signedness: 'int' to 'char' [-Wsign-conversion]
  warning: unused parameter '...' [-Wunused-parameter]
  warning: use of old-style cast [-Wold-style-cast]
Use with caution!