Quantcast
Browsing all 22022 articles
Browse latest View live

What's the difference between the .ascii and the .string assembler directives?

I know that the .ascii directive doesn't put a null character at the end of the string. The .asciz directive is used for that purpose. However, I don't know whether the .string directive puts a null...

View Article


Strcmp Problem Segmantation Fault insert method not working

I used GDB, and realised that the problem was reaching these line of codes:in main:''' else if(strcmp("insert",arg[1])==0){ insert("a.txt","Cem","Mec","Cem","-a");}'''insert method:'''void insert(char...

View Article


Error message in codeblocks: Undefined reference to 'WinMain@16'

I want to run the following code in Codeblocks 20.03, but I get the error message: Undefined reference to 'WinMain@16'. Code:std::string countSheep(int number) { std::string res; std::string s = "...

View Article

How to generate dependency files when generating object files of c sources...

I am implementing a build system using the GNU tools, GCC and make to compile multiple targets, link them together and create a final executable. All these support two platforms; the host environment...

View Article

How to link MinGW (gcc) and TBB

I am trying to compile my TBB program using MinGW. I know that TBB is installed on my machine correctly because it compiles just fine in Visual Studio. Do I have to do something more to tell MinGW...

View Article


return-value deduction for non-static method pointers

I was toying around with function pointers to non-static methods and stumbled upon some GCC-messages that don't quite make sense to me. Let's maybe look at some code:#include<iostream>struct X{...

View Article

VS Code will not build c++ programs with multiple .ccp source files

Note that I'm using VS Code on Ubuntu 17.10 and using the GCC Compiler.I'm having trouble building a simple program which makes use of additional .ccp files. I'm probably missing something obvious here...

View Article

Odd error in the CYGWIN console "cygheap base mismatch detected"

I wrote some simple application in C (for test) - GCC 9.3.0 on CYGWIN (x86_64-pc-cygwin) on Windows 10. And it worked fine. But 1-2 days ago Windows 10 was updated (Feature Update 1909 (2)). I dont...

View Article


Why LSan (with gcc) doesn't find memory leaks which are allocated by mmap?

I tested it with below code// main.c#include <sys/mman.h>#include <string.h>#include <stdlib.h>int main() { int* ptr1 = (int*)malloc(1); int* ptr2 = (int*)mmap(0, 4096*10,...

View Article


asm/errno.h: No such file or directory

While building gcc, I get this error:In file included from /usr/include/bits/errno.h:25, from /usr/include/errno.h:36, from ../.././gcc/tsystem.h:96, from...

View Article

g++ only looks for .lib files

I am using Windows 10 with mingw-w64. I tried compiling a program with a statically linked library. I used this command: g++ main.cpp -Llibs/ -lfoo. But MinGW says it can't find the library files, so I...

View Article

Image may be NSFW.
Clik here to view.

Not picking up the correct GCC verison

I am running an environment which requires an older version of gcc (gcc.4.8.3 to be exact).I have this version of gcc sitting at location: /usr/local/bin (see below)I have appended /usr/local/bin to my...

View Article

What is GCC lto wrapper?

I am using buildroot to prepare images for embedded system. I want to export buildroots internal cross compiler so others can use same version, After command checking GCC version: arm-linux-gcc -vI see...

View Article


Does pthread_mutex_lock contains memory fence instruction? [duplicate]

Do pthread_mutex_lock and pthread_mutex_unlock functions call memory fence/barrier instructions? Or do the the lower level instructions like compare_and_swap implicity have memory barriers?

View Article

problems with using types from stdint.h header

I have a header file ptestlib.h, whose contents are given below:#ifndef INCLUDED#define INCLUDED#ifndef FALSE#define FALSE (0)#endif#ifndef TRUE#define TRUE (!FALSE)#endif/* optimization levels...

View Article


Using GCC to produce readable assembly?

I was wondering how to use GCC on my C source file to dump a mnemonic version of the machine code so I could see what my code was being compiled into. You can do this with Java but I haven't been able...

View Article

CMAKE_C_COMPILER is not a full path to an existing compiler tool

I recently explored distcc and couldn't make it work. So I sudo apt-get remove distccAfter that, I get the error ==> Processing catkin package: 'gencpp'==> Building with env:...

View Article


GAS Assembly : switch - default case trigger [duplicate]

I am analysing how switch is converted from C to aseembly (GAS). I don't understand the GAS's trick how the 'lower edge' default is triggered. There is a conditional jump for 'higher edge' : cmpl $8,...

View Article

GCC Bit-scan-forward to find next set bit?

I have a uint64_t and I would like to find the index of the first set bit, reset it to zero and find the next set bit. How do I know when to terminate? BSF on all zeros is undefined...const uint64_t...

View Article

What are the "STANDARD SYSTEM DIRECTORIES" that gcc refers to? (On a unix...

I've been exploring compilers and cross compilers. I'm reading the GCC manual.Specifically, there are these statements in the manual that I have queries regarding:The linker searches a standard list of...

View Article
Browsing all 22022 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>