Tag Archives: gcc

Pitfalls in negative indexing in C

Negative indexing in C, such as a[-1], is legit, although rarely used. There are reasons (pitfalls) why negative indexing is not recommended. This post discusses these pitfalls when using negative indexing (for fun). 1. Negative indexing within the bound In … Continue reading

Posted in Programming | Tagged , | Leave a comment

Understanding kcov – play with -fsanitize-coverage=trace-pc from the user space

kcov is a kernel feature used to support syzkaller[1]. To provide the code coverage information from the kernel itself, the GCC compiler was patched to instrument the kernel image[2]. The kernel itself was also patched to enable this feature where … Continue reading

Posted in OS, Security, Stuff about Compiler | Tagged , , | Leave a comment

gcc, llvm, and Linux kernel

This post talks about what happened recently in the Linux kernel mailing list discussion. While this post does not dig into compiler internals or the whole picture between the Linux kernel and compilers, we discuss 2 specific issues from gcc … Continue reading

Posted in OS, Stuff about Compiler | Tagged , , , , | Leave a comment

Cross compile user-space applications using Yocto for Gumstix Overo

An official way to add a software package using Yocto is to add a new layer if there is no recipe existing for this package. Then baking the whole image should have it included. However, we are not going to … Continue reading

Posted in Embedded System, IDE_Make | Tagged , , , , , | Leave a comment

Build official Debian linux kernel

Comparing with ‘normal’ Linux kernel build, the ‘official’ Linux kernel build for each distribution is confusing and awkward. Debian 7.1 Wheezy may be friendly but still needs cautions. The good thing is you do not need to patch the original … Continue reading

Posted in OS | Tagged , , , , , | 1 Comment

Valgrind – dynamic code analysis tool – part VI – configure: error: please use gcc >= 3.0 or clang >= 2.9

This post is trying to figure out the reason why configure of valgrind may report the error like this – configure: error: please use gcc >= 3.0 or clang >= 2.9 and the stupid workaround to make the building go … Continue reading

Posted in Static Code Analysis | Tagged , , | Leave a comment

RedHat 6 – Porting code to RH6

We are moving our product’s OS from RedHat 5 to 6, as well as new version of ‘gcc’ (4.X) along with RH6.  To port the existing code to RH6 with new compiler, there might be a lot of things we … Continue reading

Posted in OS, Programming, Stuff about Compiler | Tagged , , , | 1 Comment

Uninit structure member – Uninit checking and static code analysis

A recent software bug caused a serious data damage in our customer’s side, which is using an uninit sturcture member. This post gives a practical comparison between kinds of static code analysis tools for this specific bug among popular commerical … Continue reading

Posted in Static Code Analysis | Tagged , , , , , , , | Leave a comment

Bug in g++ 3.X – invalid operands of types `A&’ and `int’ to binary `operator!=’

I am not sure if there is a bug declaration for g++ 3.X (have not checked the doc yet). On the other hand, g++ 4.X, however, could compile the example code below silently. Anyway, seems for g++ 3.X, reference operator … Continue reading

Posted in Programming, Stuff about Compiler | Tagged , | 1 Comment

x86 assembly programming with GNU – tool tips

1. coding pattern # Pattern used by as and ld .section .data < initialized data here> .section .bss < uninitialized data here> .section .text .globl _start _start: < instruction code here> ———————————- # Pattern used by gcc .section .data < … Continue reading

Posted in Programming | Tagged , , , , , , , , | Leave a comment