Search Results

Search found 535 results on 22 pages for 'compilers'.

Page 6/22 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Building 64bit Qt on 32bit Xp computer

    - by photo_tom
    I'm trying to build Qt in a shared 64 bit mode on my 32bit XP system. I can configure the QMake and start the 64bit build. The problem is that when the build starts, the first thing that happens in that the process builds ui, moc and rcc utility compilers in 64 bit mode, then tries to run them on my 32bit machine. Does anyone know how to configure the build so that it does not build those compilers first?

    Read the article

  • C/C++ line number

    - by Betamoo
    In the sake of debugging purposes, can I get the line number in C/C++ compilers? (standard way or specific ways for certain compilers) e.g if(!Logical) printf("Not logical value at line number %d \n",LineNumber); // How to get LineNumber without writing it by my hand?(dynamic compilation) Thanks

    Read the article

  • Why is the order of evaluation for function parameters undefined in c++?

    - by kunj2aan
    The standard doesn't specify the order of evaluation of arguments with this line: The order of evaluation of arguments is unspecified. What does Better code can be generated in the absence of restrictions on expression evaluation order imply? What is the drawback in asking all the compilers to evaluate the function arguments Left to Right for example? What kinds of optimizations do compilers perform because of this undefined spec?

    Read the article

  • OpenSource programming-languages in development?

    - by pile of junk
    I'm very interested in interpreter and compiler development and because I don't want to continue building mini compilers and interpreters I thought I could help some open-source project. Are there currently open-source projects on compilers/interpreters in early stages seeking developers? I mean yeah.. There won't be much to do for someone like me in Python, Ruby, and so on.

    Read the article

  • How bad is code using std::basic_string<t> as a contiguous buffer?

    - by BillyONeal
    I know technically the std::basic_string template is not required to have contiguous memory. However, I'm curious how many implementations exist for modern compilers that actually take advantage of this freedom. For example, if one wants code like the following it seems silly to allocate a vector just to turn around instantly and return it as a string: DWORD valueLength = 0; DWORD type; LONG errorCheck = RegQueryValueExW( hWin32, value.c_str(), NULL, &type, NULL, &valueLength); if (errorCheck != ERROR_SUCCESS) WindowsApiException::Throw(errorCheck); else if (valueLength == 0) return std::wstring(); std::wstring buffer; do { buffer.resize(valueLength/sizeof(wchar_t)); errorCheck = RegQueryValueExW( hWin32, value.c_str(), NULL, &type, &buffer[0], &valueLength); } while (errorCheck == ERROR_MORE_DATA); if (errorCheck != ERROR_SUCCESS) WindowsApiException::Throw(errorCheck); return buffer; I know code like this might slightly reduce portability because it implies that std::wstring is contiguous -- but I'm wondering just how unportable that makes this code. Put another way, how may compilers actually take advantage of the freedom having noncontiguous memory allows? Oh: And of course given what the code's doing this only matters for Windows compilers.

    Read the article

  • floating point equality in Python and in general

    - by eric.frederich
    I have a piece of code that behaves differently depending on whether I go through a dictionary to get conversion factors or whether I use them directly. The following piece of code will print 1.0 == 1.0 -> False But if you replace factors[units_from] with 10.0 and factors[units_to ] with 1.0 / 2.54 it will print 1.0 == 1.0 -> True #!/usr/bin/env python base = 'cm' factors = { 'cm' : 1.0, 'mm' : 10.0, 'm' : 0.01, 'km' : 1.0e-5, 'in' : 1.0 / 2.54, 'ft' : 1.0 / 2.54 / 12.0, 'yd' : 1.0 / 2.54 / 12.0 / 3.0, 'mile' : 1.0 / 2.54 / 12.0 / 5280, 'lightyear' : 1.0 / 2.54 / 12.0 / 5280 / 5.87849981e12, } # convert 25.4 mm to inches val = 25.4 units_from = 'mm' units_to = 'in' base_value = val / factors[units_from] ret = base_value * factors[units_to ] print ret, '==', 1.0, '->', ret == 1.0 Let me first say that I am pretty sure what is going on here. I have seen it before in C, just never in Python but since Python in implemented in C we're seeing it. I know that floating point numbers will change values going from a CPU register to cache and back. I know that comparing what should be two equal variables will return false if one of them was paged out while the other stayed resident in a register. Questions What is the best way to avoid problems like this?... In Python or in general. Am I doing something completely wrong? Side Note This is obviously part of a stripped down example but what I'm trying to do is come with with classes of length, volume, etc that can compare against other objects of the same class but with different units. Rhetorical Questions If this is a potentially dangerous problem since it makes programs behave in an undetermanistic matter, should compilers warn or error when they detect that you're checking equality of floats Should compilers support an option to replace all float equality checks with a 'close enough' function? Do compilers already do this and I just can't find the information.

    Read the article

  • Achieving forward compatibility with C++11

    - by mcmcc
    I work on a large software application that must run on several platforms. Some of these platforms support some features of C++11 (e.g. MSVS 2010) and some don't support any (e.g. GCC 4.3.x). I see this situation continuing on for several years (my best guess: 3-5 years). Given that, I would like set up a compatibility interface such that (to whatever degree possible) people can write C++11 code that will still compile with older compilers with a minimum of maintenance. Overall, the goal is to minimize #ifdef's as much as reasonably possible while still enabling basic C++11 syntax/features on the platforms that support them, and provide emulation on the platforms that don't. Let's start with std::move(). The most obvious way to achieve compatibility would be to put something like this in a common header file: #if !defined(HAS_STD_MOVE) namespace std { // C++11 emulation template <typename T> inline T& move(T& v) { return v; } template <typename T> inline const T& move(const T& v) { return v; } } #endif // !defined(HAS_STD_MOVE) This allow people to write things like std::vector<Thing> x = std::move(y); ... with impugnity. It does what they want in C++11 and it does the best it can in C++03. When we finally drop the last of the C++03 compilers, this code can remain as is. However, according to the standard, it is illegal to inject new symbols into the std namespace. That's the theory. My question is, practically speaking, is there any harm in doing this as a way of achieving forward compatibility?

    Read the article

  • Styles of games that work at low-resolution

    - by Brendan Long
    I'm taking a class on compilers, and the goal is to write a compiler for Meggy Jr devices (Arduino). The goal is just to make a simple compilers with loops and variables and stuff. Obviously, that's lame, so the "real goal" is to make an impressive game on the device. The problem is that it only has 64 pixels to work with (technically 72, but the top 8 are single-color and not part of the main display, so they're really only useful for displaying things like money). My problem is thinking of something to do on a device that small. It doesn't really matter if it's original, but it can't be something that's already available. My first idea was "snake", but that comes with the SDK. Same with a side-scrolling shooter. Remaining ideas include a tower defense game (hard to write, hard to control), an RPG (same), tetris (lame).. The problem is that all of the games I like require a high-resolution screen because they have a lot of text. Even a really simple game like nethack would be hard because each creature would be a single color. tl;dr What styles of games require a. No text; and b. Few enough objects that representing them each with a single color is acceptable? EDIT: To clarify, the display is 8x8 for a total of 64 pixels, not 64x64.

    Read the article

  • Styles of games that work at low-resolution

    - by Brendan Long
    I'm taking a class on compilers, and the goal is to write a compiler for Meggy Jr devices (Arduino). The goal is just to make a simple compilers with loops and variables and stuff. Obviously, that's lame, so the "real goal" is to make an impressive game on the device. The problem is that it only has 64 pixels to work with (technically 72, but the top 8 are single-color and not part of the main display, so they're really only useful for displaying things like money). My problem is thinking of something to do on a device that small. It doesn't really matter if it's original, but it can't be something that's already available. My first idea was "snake", but that comes with the SDK. Same with a side-scrolling shooter. Remaining ideas include a tower defense game (hard to write, hard to control), an RPG (same), tetris (lame).. The problem is that all of the games I like require a high-resolution screen because they have a lot of text. Even a really simple game like nethack would be hard because each creature would be a single color. tl;dr What styles of games require a. No text; and b. Few enough objects that representing them each with a single color is acceptable?

    Read the article

  • How can I port msvc++ code with non-dependent names in templates to Linux?

    - by user352382
    I can deal with porting platform dependent functions. I have a problem that the compilers I tried on Linux (clang and g++) do not accept the following code, while the msvc++ compiler does: template <class T> class Base { protected: T Value; }; template <class T> class Derived : public Base<T> { public: void setValue(const T& inValue){ Value = inValue; } }; int main(int argc, char const *argv[]) { Derived<int> tmp; tmp.setValue(0); return 0; } g++ error: main.cpp: In member function ‘void Derived<T>::setValue(const T&)’: main.cpp:11:3: error: ‘Value’ was not declared in this scope I believe this due to the use of a non-dependent name (Value) in the second class. More information. The problem is that I have a very large code base, in which this type of code is used very often. I understand that it is wrong when looking at the standard. However it is very convenient not having to write this-> or Base<T>:: in front of every use of Value. Even writing using Base<T>::Value; at the start of the derived class is problematic when you use ~20 members of the base class. So my question is: are there compilers for Linux that allow this kind of code (with or without extra compiler switches)? Or are there small modifications that will allow this code to compile on Linux?

    Read the article

  • Solaris 11.2: Functional Deprecation

    - by alanc
    In Solaris 11.1, I updated the system headers to enable use of several attributes on functions, including noreturn and printf format, to give compilers and static analyzers more information about how they are used to give better warnings when building code. In Solaris 11.2, I've gone back in and added one more attribute to a number of functions in the system headers: __attribute__((__deprecated__)). This is used to warn people building software that they’re using function calls we recommend no longer be used. While in many cases the Solaris Binary Compatibility Guarantee means we won't ever remove these functions from the system libraries, we still want to discourage their use. I made passes through both the POSIX and C standards, and some of the Solaris architecture review cases to come up with an initial list which the Solaris architecture review committee accepted to start with. This set is by no means a complete list of Obsolete function interfaces, but should be a reasonable start at functions that are well documented as deprecated and seem useful to warn developers away from. More functions may be flagged in the future as they get deprecated, or if further passes are made through our existing deprecated functions to flag more of them. Header Interface Deprecated by Alternative Documented in <door.h> door_cred(3C) PSARC/2002/188 door_ucred(3C) door_cred(3C) <kvm.h> kvm_read(3KVM), kvm_write(3KVM) PSARC/1995/186 Functions on kvm_kread(3KVM) man page kvm_read(3KVM) <stdio.h> gets(3C) ISO C99 TC3 (Removed in ISO C11), POSIX:2008/XPG7/Unix08 fgets(3C) gets(3C) man page, and just about every gets(3C) reference online from the past 25 years, since the Morris worm proved bad things happen when it’s used. <unistd.h> vfork(2) PSARC/2004/760, POSIX:2001/XPG6/Unix03 (Removed in POSIX:2008/XPG7/Unix08) posix_spawn(3C) vfork(2) man page. <utmp.h> All functions from getutent(3C) man page PSARC/1999/103 utmpx functions from getutentx(3C) man page getutent(3C) man page <varargs.h> varargs.h version of va_list typedef ANSI/ISO C89 standard <stdarg.h> varargs(3EXT) <volmgt.h> All functions PSARC/2005/672 hal(5) API volmgt_check(3VOLMGT), etc. <sys/nvpair.h> nvlist_add_boolean(3NVPAIR), nvlist_lookup_boolean(3NVPAIR) PSARC/2003/587 nvlist_add_boolean_value, nvlist_lookup_boolean_value nvlist_add_boolean(3NVPAIR) & (9F), nvlist_lookup_boolean(3NVPAIR) & (9F). <sys/processor.h> gethomelgroup(3C) PSARC/2003/034 lgrp_home(3LGRP) gethomelgroup(3C) <sys/stat_impl.h> _fxstat, _xstat, _lxstat, _xmknod PSARC/2009/657 stat(2) old functions are undocumented remains of SVR3/COFF compatibility support If the above table is cut off when viewing in the blog, try viewing this standalone copy of the table. To See or Not To See To see these warnings, you will need to be building with either gcc (versions 3.4, 4.5, 4.7, & 4.8 are available in the 11.2 package repo), or with Oracle Solaris Studio 12.4 or later (which like Solaris 11.2, is currently in beta testing). For instance, take this oversimplified (and obviously buggy) implementation of the cat command: #include <stdio.h> int main(int argc, char **argv) { char buf[80]; while (gets(buf) != NULL) puts(buf); return 0; } Compiling it with the Studio 12.4 beta compiler will produce warnings such as: % cc -V cc: Sun C 5.13 SunOS_i386 Beta 2014/03/11 % cc gets_test.c "gets_test.c", line 6: warning: "gets" is deprecated, declared in : "/usr/include/iso/stdio_iso.h", line 221 The exact warning given varies by compilers, and the compilers also have a variety of flags to either raise the warnings to errors, or silence them. Of couse, the exact form of the output is Not An Interface that can be relied on for automated parsing, just shown for example. gets(3C) is actually a special case — as noted above, it is no longer part of the C Standard Library in the C11 standard, so when compiling in C11 mode (i.e. when __STDC_VERSION__ >= 201112L), the <stdio.h> header will not provide a prototype for it, causing the compiler to complain it is unknown: % gcc -std=c11 gets_test.c gets_test.c: In function ‘main’: gets_test.c:6:5: warning: implicit declaration of function ‘gets’ [-Wimplicit-function-declaration] while (gets(buf) != NULL) ^ The gets(3C) function of course is still in libc, so if you ignore the error or provide your own prototype, you can still build code that calls it, you just have to acknowledge you’re taking on the risk of doing so yourself. Solaris Studio 12.4 Beta % cc gets_test.c "gets_test.c", line 6: warning: "gets" is deprecated, declared in : "/usr/include/iso/stdio_iso.h", line 221 % cc -errwarn=E_DEPRECATED_ATT gets_test.c "gets_test.c", line 6: "gets" is deprecated, declared in : "/usr/include/iso/stdio_iso.h", line 221 cc: acomp failed for gets_test.c This warning is silenced in the 12.4 beta by cc -erroff=E_DEPRECATED_ATT No warning is currently issued by Studio 12.3 & earler releases. gcc 3.4.3 % /usr/sfw/bin/gcc gets_test.c gets_test.c: In function `main': gets_test.c:6: warning: `gets' is deprecated (declared at /usr/include/iso/stdio_iso.h:221) Warning is completely silenced with gcc -Wno-deprecated-declarations gcc 4.7.3 % /usr/gcc/4.7/bin/gcc gets_test.c gets_test.c: In function ‘main’: gets_test.c:6:5: warning: ‘gets’ is deprecated (declared at /usr/include/iso/stdio_iso.h:221) [-Wdeprecated-declarations] % /usr/gcc/4.7/bin/gcc -Werror=deprecated-declarations gets_test.c gets_test.c: In function ‘main’: gets_test.c:6:5: error: ‘gets’ is deprecated (declared at /usr/include/iso/stdio_iso.h:221) [-Werror=deprecated-declarations] cc1: some warnings being treated as errors Warning is completely silenced with gcc -Wno-deprecated-declarations gcc 4.8.2 % /usr/bin/gcc gets_test.c gets_test.c: In function ‘main’: gets_test.c:6:5: warning: ‘gets’ is deprecated (declared at /usr/include/iso/stdio_iso.h:221) [-Wdeprecated-declarations] while (gets(buf) != NULL) ^ % /usr/bin/gcc -Werror=deprecated-declarations gets_test.c gets_test.c: In function ‘main’: gets_test.c:6:5: error: ‘gets’ is deprecated (declared at /usr/include/iso/stdio_iso.h:221) [-Werror=deprecated-declarations] while (gets(buf) != NULL) ^ cc1: some warnings being treated as errors Warning is completely silenced with gcc -Wno-deprecated-declarations

    Read the article

  • graphics programming

    - by PVB
    hi , i would like to program some graphic figures such as line, circle,etc. i have used turboc++ 3.0 for dos graphics. i would like to do the same with the compilers dev c++ or code blocks or vc++. i would like to implement dda and bresenhems line and circle drawing algorithm. how should i go about implementing these programs through these compilers (not the command line tools). i have a really vague picture of graphics programming.please help.. thanks in advance. please note : i have a nvidia graphics card 1gb.. so i cannot use dos graphics (i think the card is the reason).

    Read the article

  • How do I get Nant to use the 4.0 compiler to target .Net 3.5

    - by Rory Becker
    Yes I know that sounds a little bit crazy, but I've got .Net 3.5 deployed in the field and I'd like to use the new 4.0 compiler to target it. There are several new syntactic sugar features in the latest versions of Vb.Net and C# which I would like to use,but I am unable (just yet) to enforce a new version of the .Net framework and CLR on my client base. Before the nay sayers jump in with both feet... I have just successfully used Studio 2010 to compile a 3.5 targeted app which used VB.Net auto properties (A new feature in VB.Net 10) so I know the compilers are capable somehow. So back to my question.... How do I convince Nant to use the 4.0 compiler, but to target .Net 3.5 (CLR 2.0) Update: I am using the csc and vbc tasks and not the Solution task. although I'd settle for an answer on how to do this direct with the compilers at this point.

    Read the article

  • How does opendir work in Perl 6?

    - by sid_com
    Hello! Can someone tell me, why the "opendir" doesn't work? #!/usr/bin/env perl6 use v6; my $file = 'Dokumente/test_file'; if ( my $fh = open $file, :r ) { for $fh.lines -> $line { say $line; } } else { say "Could not open '$file'"; } my $dir = 'Dokumente'; my $dh = opendir $dir err die "Could not open $dir: $!"; Output: Hello, World! Line 2. Last line. Could not find non-existent sub &opendir current instr.: '_block14' pc 29 (EVAL_1:0) called from Sub '!UNIT_START' pc 1163 (src/glue/run.pir:20) called from Sub 'perl6;PCT;HLLCompiler;eval' pc -1 ((unknown file):-1) called from Sub 'perl6;PCT;HLLCompiler;evalfiles' pc 1303 (compilers/pct/src/PCT/HLLCompiler.pir:707) called from Sub 'perl6;PCT;HLLCompiler;command_line' pc 1489 (compilers/pct/src/PCT/HLLCompiler.pir:794) called from Sub 'perl6;Perl6;Compiler;main' pc -1 ((unknown file):-1)

    Read the article

  • How do I build mDNSResponder?

    - by Alex
    I have tried checking out the mDNSResponder source from Apple's SVN host, with the thought of compiling it and tweaking it. This failed miserably. Here is the last line of the output of cd trunk SRCROOT=. make I get the same error for several tags in the SVN tree, so I'm not sure if there is something on my end wrong? The following build commands failed: mDNSResponder: CompileC mDNSResponder.build/mDNSResponder.build/Objects-normal/i386/mDNSMacOSX.o /Users/myname/Desktop/mDNSResponder/trunk/mDNSMacOSX/mDNSMacOSX.c normal i386 c com.apple.compilers.gcc.4_2 PhaseScriptExecution "Run Script" /Users/myname/Desktop/mDNSResponder/trunk/mDNSMacOSX/mDNSResponder.build/mDNSResponder.build/Script-D284BE6C0ADD80740027CCDF.sh mDNSResponder debug: CompileC "mDNSResponder.build/mDNSResponder debug.build/Objects-normal/i386/mDNSMacOSX.o" /Users/myname/Desktop/mDNSResponder/trunk/mDNSMacOSX/mDNSMacOSX.c normal i386 c com.apple.compilers.gcc.4_2 Build Some: PhaseScriptExecution "Run Script" "/Users/myname/Desktop/mDNSResponder/trunk/mDNSMacOSX/mDNSResponder.build/Development/Build Some.build/Script-FF045B6A0C7E4AA600448140.sh" (4 failures)

    Read the article

  • Visualize compiler warnings

    - by christoffer
    I'm looking for a way to visualize compiler warnings and remarks, by annotating or otherwise showing which lines cause a report. This is much like a modern IDE like NetBeans or Eclipse already does, but I'd like to take output from several compilers (and other static code analysis tools) at once, and create one single annotation in order to get a better overview. The rationale is that we've seen some problems go completely undetected by, say, Visual Studio 2005, but accurately detected with a proprietary ARM compiler, and vice versa. Cross-referencing warnings could potentially locate problems better, but doing so completely manually is infeasible. Have you heard of such a tool? Could an open-source IDE like Eclipse be extended to use several compilers at once, or has it already been done?

    Read the article

  • C++0x optimizing compiler quality

    - by aaa
    hello. I do some heavy numbercrunching and for me floating-point performance is very important. I like performance of Intel compiler very much and quite content with quality of assembly it produces. I am thinking at some point to try C++0x mainly for sugar parts, like auto, initializer list, etc, but also lambdas. at this point I use those features in regular C++ by the means of boost. How good of assembly code do compilers C++0x generate? specifically Intel and gcc compilers. Do they produce SSE code? is performance comparable to C++? are there any benchmarks? My Google search did not reveal much. Thank you.

    Read the article

  • ANSI C++: Diferences between delete and delete[]

    - by Sunscreen
    I was looking a snipset of code: int* ip; ip = new int[100]; delete ip; The example above states that: "This code will work with many compilers, but it should instead read:" int* ip; ip = new int[100]; delete [] ip; Is this indeed the case? I use the compiler "Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 11.00.7022 for 80x86" and does not complain (first example) while compiling. At runtime the pointer is set to NULL. Other compilers behave diferrently? Can a compiler not compain and issues can appear at runtime? Thanks, Sun

    Read the article

  • Port Compiler Options (8 replies)

    I currently own a license for Crossworks for ARM and would like to compile the port using it. With the code for the CLR now available, is it possible to compile the port with any ARM compiler or are we still restricted to the Keil ARM gcc compilers?

    Read the article

  • Use of c89 in GNU software

    - by Federico Culloca
    In GNU coding standard it is said that free software developer should use C89 because C99 is not widespread yet. 1999 Standard C is not widespread yet, so please do not require its features in programs. Reference here. Are they talking about developers knowledge of C99, or about compilers supporting it? Also, is this statement plausible as of today or is it somewhat "obsolete" or at least obsolescent.

    Read the article

  • Port Compiler Options (8 replies)

    I currently own a license for Crossworks for ARM and would like to compile the port using it. With the code for the CLR now available, is it possible to compile the port with any ARM compiler or are we still restricted to the Keil ARM gcc compilers?

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >