Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Browsing all 22046 articles
Browse latest View live
↧

Initializing a dynamically-sized Variable-Length Array (VLA) to 0 [duplicate]

The following line of code, which creates a variable-length array on the stack:char name[length] = {'\0'};Generates the following compiler diagnostics:error: variable-sized object may not be...

View Article


Image may be NSFW.
Clik here to view.

c enum with 32 bit values

i need some unsigned 32bit enum values for my software, therefore i implemented this (simple) enum:enum{ val1 = 0xFFFFFFFFu, val2 = 0xFFFFFFFEu, val3 = 0xFFFFFFF0};The problem: Everytime i run the...

View Article


Unable to offload to GPU using openMP in gcc, omp_get_num_devices returns 0

I've made a simple test program to offload a SAXPY workload to the GPU with openMP, but have been unable to detect the presence of the GPU. I'm unsure if the compiler is configured correctly for this...

View Article

How to manually throw a compiler error in GCC and Xcode

In xcode, while compiling apps with gcc, I want to throw compilation time errors if things like NSZombieEnabled is on for a distribution release, thus ensuring that compilation will fail and I won't...

View Article

The big prefix L has no effect in %Lf, the result in printf() is same as just...

Currently learning about C language, I repeated after guy in tutorial, he used printf("value = %Lf\n", var_some); construction to output the value of long double variable, and it worked.But when I...

View Article


Trying to no-op an instruction

Is it possible using GNU tools (gcc, binutils, etc) to modify all occurrences of an assembly instruction into a no-op? Specifically, gcc with the -pg option generates the following assembly (ARM): 0x0:...

View Article

GCC switches to enable analysis for warnings

In GCC, certain warnings require optimization to be enabled. For example:int foo() { int x; return x;}In order to detect the uninitialized variable, -O must be passed.$ gcc -W -Wall -c test.c$ gcc -W...

View Article

ld64 -s strip output flag - "ignored" but not really? OS X

I was bored and playing around with various options to gcc to see what size binaries I could produce.I found a -s flag in ld64 that is supposedly supposed to not include symbol table information in an...

View Article


Is there a way to output the assembly of a single function in isolation?

I am learning how a C file is compiled to machine code. I know I can generate assembly from gcc with the -S flag, however it also produces a lot of code to do with main() and printf() that I am not...

View Article


C++ #include and #import difference

What is the difference between #include and #import in C++?

View Article

Prevent optimization of arithmetic computation

I need to implement this paperPage 5, there is a functionvoid Split(double a, double *x, double *y) { double z = a * ((1 << r) + 1); *x = z - (z - a); *y = a - *x;}With -O3 (which I need for the...

View Article

GCC 4.5/Ubuntu 11.04 is auto-threading code?

I apologize ahead of time that I don't quite have the proper jargon to describe my problem, and that I have likely not given enough information.I've been running my MPI code under gcc 4.4 and...

View Article

Check glibc version for a particular gcc compiler

I have two gcc compilers installed on my system, one is gcc 4.1.2 (default) and the other is gcc 4.4.4. How can I check the libc version used by gcc 4.4.4, because /lib/libc.so.6 shows the glibc used...

View Article


How can you determine installed versions of the glibc libraries?

I'm working with an embedded Linux deployment and am using a cross compiler tool chain that doesn't compile I2C library function calls.How do I determine the precise versions of the libraries on the...

View Article

Is there anything wrong with changing the default compiler in Xcode 4.2 to...

I am having some issues in my app since the advent of iOS 5, and I am trying to figure out what in the world is going on. One of the noticeable differences in the development environment is the switch...

View Article


Compile time comparison between Windows GCC and MSVC compiler

We are working on reducing compile times on Windows and are therefore considering all options. I've tried to look on Google for a comparison between compile time using GCC (MinGW or Cygwin) and MSVC...

View Article

Visual C++ equivalent of GCC's __attribute__ ((__packed__))

For some compilers, there is a packing specifier for structs, for example ::RealView ARM compiler has "__packed"Gnu C Compiler has "__attribute__ ((__packed__))"Visual C++ has no equivalent, it only...

View Article


How do I build a static library for iPhone?

I think that I've looked everywhere for an answer to my problem but without any luck.I'm trying to create a simple static lib to run on the iPhone device but I keep ending up with XCode saying that...

View Article

Set default GCC to Fink-installed GCC 4.5?

I've got GCC 4.2 that came with my installation of Mac OS X 10.6.4, plus GCC 4.5 installed via Fink. I wanted to use gcc_select to change the default compiler to GCC 4.5, but was told gcc_select does...

View Article

I am writing my OS. Kernel is in panic state after implementing hardware...

I am trying to enable hardware interrupts and currently implementing PIC, But kernel is going into panic state.I am using nasm and C to write my kernel. Please help.When i call enable_interrupts() in...

View Article
Browsing all 22046 articles
Browse latest View live


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