Questions tagged [gnu]

This tag is for programming questions related to software and tools provided by the GNU ("GNU's Not Unix") project.

The GNU Project is a free software, mass collaboration project, announced on September 27, 1983, by Richard Stallman at MIT. It initiated GNU operating system development in 1984. The founding goal of the project was, in the words of its initial announcement, to develop "a sufficient body of free software [...] to get along without any software that is not free."

To make this happen, the GNU Project began working on an operating system called GNU ("GNU" is a recursive acronym that stands for "GNU's Not Unix"). This goal of making a free software operating system was achieved in 1992 when the last gap in the GNU system, a kernel, was filled by the third-party Linux kernel being released as Free Software, under version 2 of the GNU GPL.

2807 questions
27
votes
2 answers

Difference between Program header and Section Header in ELF

Q1 What is the difference between Program header and Section Header in ELF? Q1.1 What is the difference between segment and a section? I believe pheaders point to sections only. Q2. What is the difference between File Header and Program Header? As…
user435739
27
votes
3 answers

Increase stack size in Linux with setrlimit

reading information about how to increase stack size for a c++ application compiled with gnu, at compilation time, I understood that it can be done with setrlimit at the beginning of the program. Nevertheless I could not find any successful example…
asdf
  • 2,281
  • 5
  • 28
  • 29
26
votes
1 answer

error: cannot convert 'std::basic_string::iterator ...' to 'const char* for argument '1' ...'

I'm getting the following error: error: cannot convert 'std::basic_string::iterator {aka __gnu_cxx::__normal _iterator >}' to 'const char*' for argument '1' to 'int remove(const char*)' For some reason, my…
anonymous
  • 815
  • 3
  • 13
  • 21
24
votes
7 answers

How do I diff utf-16 files with GNU diff?

GNU diff doesn't seem to be smart enough to detect and handle UTF-16 files, which surprises me. Am I missing an obvious command-line option? Is there a good alternative?
skiphoppy
  • 97,646
  • 72
  • 174
  • 218
24
votes
3 answers

Is g++ both a c++ compiler and a linker?

I was looking at the output from my build in Eclipse. I'm cross compiling for a ColdFire processor. The compilation line looks like this: m68k-elf-g++ -O2 -falign-functions=4 -IC:\nburn\include -IC:\nburn\MOD52... followed by more include file,…
Tod
  • 8,192
  • 5
  • 52
  • 93
24
votes
3 answers

How can I make C++0x and __STRICT_ANSI__ get along?

I need to use popen in a project, but I get: error: 'popen' was not declared in this scope It looks like GCC defines __STRICT_ANSI__ under both -std=c++0x and (contrary to what little information I was able to find) -std=gnu++0x, which causes popen…
Jon Purdy
  • 53,300
  • 8
  • 96
  • 166
24
votes
2 answers

what does the weak_alias function do and where is it defined

So I'm looking through the source of gcc compiler and I've come along this in fork.c: int __fork () { __set_errno (ENOSYS); return -1; } libc_hidden_def (__fork) stub_warning (fork) weak_alias (__fork, fork) #include I'm trying to…
Programmer123
  • 395
  • 1
  • 3
  • 8
24
votes
5 answers

How can you compare two character strings statically at compile time

I would like to create a macro which can compare 2 strings, and emit a compile time error if the condition isn't met. This could be though of as a compile time assertion. I'm not sure how I could do this. For instance: STATIC_COMPARE("THIS…
Avba
  • 14,822
  • 20
  • 92
  • 192
24
votes
1 answer

What's the difference among cflgs sse options of -msse, -msse2, -mssse3, -msse4 rtc..? and how to determine?

For the GCC CFLAGS options: -msse, -msse2, -mssse3, -msse4, -msse4.1, -msse4.2. Are they exclusive in their use or can they be used together? My understanding is that the choosing which to set depends on whether the target arch, which the program…
yaya
  • 351
  • 1
  • 2
  • 3
23
votes
8 answers

STM32 WWDG interrupt firing when not configured

I have an application that I am porting from the Keil IDE to build with the GNU toolchain due to license issues. I have successfully be able to set up, build, flash and run the application on the device. The application on the GNU side is for some…
gettingSmarter
  • 661
  • 1
  • 5
  • 15
23
votes
2 answers

sed not giving me correct substitute operation for newline with Mac - differences between GNU sed and BSD / OSX sed

I'm using this reference : sed help: matching and replacing a literal "\n" (not the newline) and I have a file "test1.txt" that contains a string hello\ngoodbye I use this command to search and replace "\n" with actual new line characters: sed -i ''…
Brandon Ling
  • 3,841
  • 6
  • 34
  • 49
22
votes
5 answers

Objective-C in web development

Is it possible/feasible to use ObjC (not necessary the Apple flavor) to develop server-side web applications? Is GNU ObjC toolchain at all usable? Please share your thoughts and experiences. Upd. I'd like to hear more answers with concrete practical…
user187291
  • 53,363
  • 19
  • 95
  • 127
22
votes
2 answers

correct way to encode/embed version number in program code

I would like to embed my software version in my code and later retrieve it from the program binary with a command like argument like -v or --version. As an example some of the GNU/Linux software binaries print their version information when supplied…
max
  • 2,627
  • 1
  • 24
  • 44
22
votes
6 answers

How to install GNU gettext on windows 7?

I need to install version 0.15 or higher of GNU's gettext so that I can use some i18n feateres with django. I've downloaded : http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz from https://www.gnu.org/software/gettext/ However I have no…
Marijus
  • 4,195
  • 15
  • 52
  • 87
21
votes
1 answer

Is there a nice way of handling multi-line input with GNU readline?

My application has a command line interface, and I'm thinking about using the GNU Readline library to provide history, an editable command line, etc. The hitch is that my commands can be quite long and complex (think SQL) and I'd like to allow users…
John Carter
  • 53,924
  • 26
  • 111
  • 144