gnu

Xcode warning: … is a GNU extension

◇◆丶佛笑我妖孽 提交于 2019-12-05 15:09:34
I use a C++ library for an iOS app. With Apple LLVM 3.1 compiler configured (default), I get a lot of warnings for this C++ code, most of them saying: ... is a GNU extension The introduction of clang's user manual says: The Clang driver and language features are intentionally designed to be as compatible with the GNU GCC compiler as reasonably possible, easing migration from GCC to Clang. In most cases, code "just works". So, is it save to just look for a switch to disable this warnings (btw. how to?) or should I better get this lib rid of all GNU extensions? You can suppress the warnings

Is Python on every GNU/Linux distribution?

心已入冬 提交于 2019-12-05 14:05:34
I would like to know if is Python on every G/L distribution preinstalled or not. And why is it so popular on GNU/Linux and not so much on Windows? Well python does not come on ALL GNU/Linux distros but is present on most of the popular Linux home user distributions (Ubuntu and Fedora Core for example), possibly because most of the application of Gnome desktop environment and KDE use python 2.5+ (not python 3 yet) interpreters. Since python is almost integrated onto the system/environment from the start, linux users feel easy to program in python. But this is a subjective opinion, as java is

Testing if a file exists in makefile target, and quitting if not present

五迷三道 提交于 2019-12-05 11:49:11
问题 Is there a way to exit with an error condition if a file does not exist? I am currently doing something like this: all: foo foo: test -s /opt/local/bin/gsort || echo "GNU sort does not exist! Exiting..." && exit Running make runs the all target, which runs foo . The expectation is that if the test -s conditional fails, then the echo/exit statements are executed. However, even if /usr/bin/gsort exists, I get the result of the echo statement but the exit command does not run. This is the

how to use the GNU hcreate_r

拟墨画扇 提交于 2019-12-05 10:45:39
#include <stdio.h> #include <stdlib.h> #include <search.h> #include <assert.h> char *data[] = { "alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", "mike", "november", "oscar", "papa", "quebec", "romeo", "sierra", "tango", "uniform", "victor", "whisky", "x-ray", "yankee", "zulu" }; int main(void) { ENTRY e, **ep; struct hsearch_data *htab; int i; int resultOfHcreate_r; resultOfHcreate_r=hcreate_r(30,htab); assert(resultOfHcreate_r!=0); hdestroy_r(htab); exit(EXIT_SUCCESS); } error in hcreate_r How to use this hcreate_r ? and other

Linux/Unix工具与正则表达式的POSIX规范--awk使用中遇到的坑

北城以北 提交于 2019-12-05 10:21:00
对正则表达式有基本了解的读者,一定不会陌生『\d』、『[a-z]+』之类的表达式,前者匹配一个数字字符,后者匹配一个以上的小写英文字母。但是如果你用过vi、grep、awk、sed之类Linux/Unix下的工具或许会发现,这些工具虽然支持正则表达式,语法却很不一样,照通常习惯的办法写的『\d』、『[a-z]+』之类的正则表达式,往往不是无法识别就是匹配错误。而且,这些工具自身之间也存在差异,同样的结构,有时需要转义有时不需要转义。这,究竟是为什么呢? 原因在于,Unix/Linux下的工具大多采用POSIX规范,同时,POSIX规范又可分为两种流派(flavor)。所以,首先有必要了解一下POSIX规范。 POSIX规范 常见的正则表达式记法,其实都源于Perl,实际上,正则表达式从Perl衍生出一个显赫的流派,叫做PCRE(Perl Compatible Regular Expression),『\d』、『\w』、『\s』之类的记法,就是这个流派的特征。但是在PCRE之外,正则表达式还有其它流派,比如下面要介绍的POSIX规范的正则表达式。 POSIX的全称是Portable Operating System Interface for uniX,它由一系列规范构成,定义了UNIX操作系统应当支持的功能,所以“POSIX规范的正则表达式”其实只是“关于正则表达式的POSIX规范

How can I make bash deal with long param using “getopt” command in mac?

佐手、 提交于 2019-12-05 10:04:26
问题 I want to make my bash script deal with long parameters. I found getopt , but it isn't supported in OS X. Can anyone tell me why getopt was implemented by BSD, but not GNU? I tried building getopt in GNU C lib, but it failed for my poor skills with Linux. Did anyone do this work? 回答1: There is a brew bottle for getopt. Just run brew install gnu-getopt . You can either specify the path for it like /usr/local/Cellar/gnu-getopt/1.1.6/bin/getopt Or use brew link --force gnu-getopt so it will be

What does -D_DEFAULT_SOURCE do?

强颜欢笑 提交于 2019-12-05 09:46:54
问题 Previously I was receiving warnings from gcc -std=c99 that usleep() was implicitly declared. Then I stumbled across this stackoverflow post, which led me to use -D_BSD_SOURCE . However, now gcc tells me that -D_BSD_SOURCE has been deprecated and I should use -D_DEFAULT_SOURCE instead. #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" Why is -D_BSD_SOURCE deprecated? Why is -D_DEFAULT_SOURCE used instead? And what does it do? I did some googling, and the results are

init-declarator-list and the GNU GCC attribute grammar

别来无恙 提交于 2019-12-05 09:06:27
I am revamping an inhouse C language bison/flex-based parser, amongst others introducing proper __ attribute__ support. Since I cannot find any official BNF-style grammar which describes GNU GCC __ attribute__ idea (except the http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html document) I am extracting bits and pieces from the C++x11 standard and comments in various implementations found over the web. I have almost got it done (at least when it comes to parsing examples included in GCC's doc cited above) but one particular example has given me a headache with no hint of solution in

configure: error: no acceptable C compiler found in $PATH

我与影子孤独终老i 提交于 2019-12-05 07:02:34
I am trying to Build and Install the Apache Thrift compiler and libraries I had to type this command is shown in instructions ./configure && make But I get this error: checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/PATH/TO/thrift-0.9.3': configure: error: no acceptable C compiler found in $PATH When I type in my command prompt gcc --version I get this gcc (GCC) 5.3.0 Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A

Can't install the caret package in R (in my Linux machine)

我们两清 提交于 2019-12-05 06:21:52
I am facing the following errors while trying to install the caret package in R. g++: error: /tmp/Rtmp2Tos7n/R.INSTALL2e6e30153a74/nloptr/nlopt-2.4.2/lib/libnlopt_cxx.a: No such file or directory make: *** [nloptr.so] Error 1 ERROR: compilation failed for package ‘nloptr’ * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/nloptr’ Warning in install.packages : installation of package ‘nloptr’ had non-zero exit status ERROR: dependency ‘nloptr’ is not available for package ‘lme4’ * removing ‘/rmt/csfiles/pgrads/mava290/R/x86_64-suse-linux-gnu-library/3.1/lme4’ Warning in