gcc-warning

Compiler error installing python-igraph: Warnings treated as errors

大兔子大兔子 提交于 2020-01-05 08:15:28
问题 Trying to install python-igraph with pip for Python 3, I get the following compiler error. Can I change something or is this a bug in igraph? Note the line cc1: some warnings being treated as errors in the end - if they are just warnings, can I just ignore them somehow? Extracting igraph-0.7.0.tar.gz... Configuring igraph... Build type: static extension Include path: igraphcore/include Library path: igraphcore/lib /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib /lib64 /lib Linked dynamic

How to silence “whose type uses the anonymous namespace [-Werror]” gcc version 4.8.2

夙愿已清 提交于 2020-01-04 06:00:36
问题 In one of my project's header file, the following line is included in a inline method typedef boost::archive::iterators::transform_width<boost::archive::iterators::binary_from_base64< boost::archive::iterators::remove_whitespace<std::string::const_iterator>>, 8, 6> Base64ToBin; When I compile this with gcc 4.8.2 I'm getting the following error: error: ‘boost::archive::iterators::remove_whitespace<__gnu_cxx::__normal_iterator > >’ has a field ‘boost::archive::iterators::remove_whitespace<__gnu

GCC issues warning of incompatible pointer type

你说的曾经没有我的故事 提交于 2020-01-03 17:49:31
问题 When I compile the program below with GCC 4.9.2 I get the following warning: passing argument 1 of ‘P’ from incompatible pointer type . However, I don't see anything wrong with the program. Any clues? typedef int Row[10]; void P(const Row A[]) { } int main(void) { Row A[10]; P(A); return 0; } Here is the complete output from GCC to stderr: test.c: In function ‘main’: test.c:12:4: warning: passing argument 1 of ‘P’ from incompatible pointer type P(A); ^ test.c:3:6: note: expected ‘const int (*

Identify use of C library functions that have locale-dependent behavior

我与影子孤独终老i 提交于 2020-01-02 13:44:30
问题 I would like to rid a C program of all uses of functions which have locale-dependent behavior, replacing them with similar functions which behave like their library counterparts in the "C" locale, regardless of the locale. This is necessary for making the program into a library which will always have the same behavior for all inputs, even if linked into a program which invokes setlocale . How can we get the GCC toolchain, in a glibc environment, to produce a diagnostic for every call to a

How to do an explicit fall-through in C

给你一囗甜甜゛ 提交于 2020-01-01 23:56:32
问题 The newer versions of gcc offer the Wimplicit-fallthrough , which is great to have for most switch statements. However, I have one switch statement where I want to allow fall throughs from all case-statements. Is there a way to do an explicit fall through? I'd prefer to avoid having to compile with Wno-implicit-fallthrough for this file. EDIT: I'm looking for a way to make the fall through explicit (if it's possible), not to turn off the warning via a compiler switch or pragma. 回答1: Use _

Suppress candidates suggested by GCC

末鹿安然 提交于 2019-12-30 09:40:12
问题 I'm using gcc 4.7.2. My code is rather heavy on template and boost usage. When I compile and I've defined or used something ambiguous, I often get error messages that suggest two dozen candidates, usually defined in their separate "in file included from [some deep path]:", with corresponding error messages per candidate on why that particular candidate fails. Especially using boost and templates, even a single error like this becomes completely unintelligible. My question: Is there an option

warnings being treated as errors in rails

夙愿已清 提交于 2019-12-24 06:45:54
问题 I have the following error when i try to make "bundle install" in my rails projects C:/Ruby22/bin/ruby.exe -r ./siteconf20150427-5772-lng4pk.rb extconf.rb creating Makefile make "DESTDIR=" clean make "DESTDIR=" generating byebug-i386-mingw32.def compiling breakpoint.c cc1.exe: warnings being treated as errors In file included from c:/Ruby22/include/ruby-2.2.0/ruby/defines.h:163:0, from c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:29, from c:/Ruby22/include/ruby-2.2.0/ruby.h:33, from ./byebug.h:4,

How to query GCC warnings for C++?

£可爱£侵袭症+ 提交于 2019-12-23 20:32:19
问题 GCC allows querying available warning flags specific for C++ language with the syntax: g++ -Q --help=warning,c++ Adding warning flags to the call includes them in the result: g++ -Wall -Q --help=warning,c++ However, it seems the call is done from the C point of view and I don't know how to do it from the C++ point of view. If the call includes C++-only warning, like: g++ -Wnon-virtual-dtor -Q --help=warning,c++ the output contains a message: cc1: warning: command line option ‘-Wnon-virtual

Suppressing “ISO C99 requires rest arguments to be used”

拈花ヽ惹草 提交于 2019-12-23 07:25:41
问题 Consider the following two macros: #define PNORM( v, s, ... ) { \ if( VERBOSITY_CHECK( v ) ) { \ if( ( errno = pthread_mutex_lock(&server.output_mutex) ) ) { \ PERROR_LOCKFREE( normal, "\tpthread_mutex_lock failed on output_mutex.\r\n" ) ; \ } \ fprintf( stdout, s, ## __VA_ARGS__ ) ; \ fflush( stdout ) ; \ if( ( errno = pthread_mutex_unlock(&server.output_mutex) ) ) { \ PERROR_LOCKFREE( normal, "\tpthread_mutex_unlock failed on output_mutex.\r\n" ) ; \ } \ } \ } #define PERROR_LOCKFREE( v, s,

mingw printf size specification character h

别等时光非礼了梦想. 提交于 2019-12-23 03:55:08
问题 Visual Studio has a size and distance specification chart that says I can do something like this, using the h prefix to specify single byte character string regardless of printf or wprintf: int main() { char test[]= "abc"; _tprintf(_T("%hs\n"),test); } But if I compile the same thing with mingw gcc and -Wall I get the following warning: warning: format '%hs' expects type 'short int *', but argument 2 has type 'char *' Is what I'm doing an acceptable way to specify a single byte character