Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the jobs of not being a compiler in C++?

Shulou Source: shulou.com Published: 2022-06-03 16:00:17 10月29日 Update

This article mainly introduces the C++ do not do the compiler work, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, let the editor take you to know about it.

For C++ programmers, sometimes they like to rewrite something according to how the compiler works in order to improve the efficiency of the code. This is really smart and reflects the level of programmers, but it is also risky to do so. Because sometimes you may make very imperceptible mistakes because of some simple clerical mistakes. Similar examples are given in this paper.

This Bug appears in the MySQL source code.

Error code:

Static int rr_cmp (uchar * a dint uchar * b) {if (a [0]! = b [0]) return (int) a [0]-(int) b [0]; if (a [1]! = b [1]) return (int) a [1]-(int) b [1]; if (a [2]! = b [2]) return (int) a [2]-(int) b [2] If (a [3]! = b [3]) return (int) a [3]-(int) b [3]; if (a [4]! = b [4]) return (int) a [4]-(int) b [4]; if (a [5]! = b [5]) return (int) a [1]-(int) b [5]

Tags: Code programs errors compilers compilers programmers work loops manual articles clocking methods sometimes subscripts odds functions performance copies arrays source code Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology NVidia Shulou Tech Info Apple