Programming :: Any Way To Defeat Automatic Type Promotion In C++ At Compile Time
Jan 15, 2011
It is known and well described in C++ standard ('C++ Standard - ANSI ISO IEC 14882 2003.pdf') that under certain circumstances types are promoted - for example, 'int' is promoted to 'double'.My design goal is to create wrappers around standard scalar types (like 'double', 'float', 'long', etc.) that would prevent such conversions/promotions, i.e. I want to create a really strictly typed C++ environment (like, say, OCaml).
However, the promotion is caught at runtime.Is there a way in C++ to catch/block such promotions/conversion at compile time ?
View 7 Replies
ADVERTISEMENT
Dec 8, 2010
Code:
#if defined(WIN32) || defined(WIN64)
#define WINDOWS
#endif
[code]....
what is the directive thats required to detect a linux system? i want to to be able to detect which platform im compiling on automatically.
View 5 Replies
View Related
Jan 14, 2010
I want pass a variable at compile time.
for example in x.c
int global_var = POSITION;
How can I send this POSITION at compile time. ie like # make POSITION=10 Is it possible?
View 5 Replies
View Related
Jan 26, 2010
I'm trying to compile a program and it gives me the following:
I checked cmath-util.h:46 and cmath-util.h:48:
I'm not a C person, and the author is unavailable so far.
View 5 Replies
View Related
Mar 1, 2009
m trying to compile a package hdf-1.6.8 for openSUSE 11.0. But i think there is a problem when gcc 4.3 is used. The make fails giving errors like:
Quote:
In file included from H5IdComponent.cpp:21: H5IdComponent.h:86: error: 'H5G_obj_t' does not name a type The header file has such entries:
Code:
H5G_obj_t p_get_refobj_type(void *ref, H5R_type_t ref_type) const;
Is this a cause for conflicts between gcc 3 and gcc 4. If so how do i rectify the same? I have compat-ltdc++ installed. Similar errors are sure to follow during the compilation process.
View 5 Replies
View Related
Feb 18, 2011
I need a download manager that automatic start download at 2 a.m and stop in 8 a.m . I test many app such as
fatrat
d4x
....
but can not find app like idm in linux.
View 2 Replies
View Related
May 3, 2011
What should I have to do if I want to back again to the previous conf of automatic Conversion to Daylight saving. Also I noted that the o/p of the zdump -v /usr/share/zoneinfo/Africa/Cairo | grep 2011 was
/usr/share/zoneinfo/Africa/Cairo Thu Apr 28 21:59:59 2011 UTC = Thu Apr 28 23:59:59 2011 EET isdst=0 gmtoff=7200
/usr/share/zoneinfo/Africa/Cairo Thu Apr 28 22:00:00 2011 UTC = Fri Apr 29 01:00:00 2011 EEST isdst=1 gmtoff=10800
/usr/share/zoneinfo/Africa/Cairo Sat Aug 20 20:59:59 2011 UTC = Sat Aug 20 23:59:59 2011 EEST isdst=1 gmtoff=10800
/usr/share/zoneinfo/Africa/Cairo Sat Aug 20 21:00:00 2011 UTC = Sat Aug 20 23:00:00 2011 EET isdst=0 gmtoff=7200
and changed to be
/usr/share/zoneinfo/Africa/Cairo -9223372036854689408 = NULL
/usr/share/zoneinfo/Africa/Cairo 9223372036854689407 = NULL
/usr/share/zoneinfo/Africa/Cairo 9223372036854775807 = NULL
After adding the new rule
Note : these are the I made to disable auto conversion to daylight saving. I created a text file named nodst at usr/share/zoneinfo/Africa
Then type the following:
#Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule egypt 2011 2013 - Apr 29 00:00 0 s
# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
Zone Africa/Cairo +2:00 egypt BRE%s
Then issue the following command
zic nodst
ln -sf /usr/share/zoneinfo/Africa/Cairo /etc/localtime
View 3 Replies
View Related
Feb 5, 2010
you can refer to this ubuntu thread for context, but i'll sum up what i'm trying to do here to spare the reading. basically i want to be able to schedule a filesystem check with automatic repairs at the next boot time. but i'm not sure if this will try to automatically fix errors which is what i want to do. the reason i want to do this is because i experienced a power outage (the machine was not plugged into an UPS) and i want to make sure everything is ok.
View 2 Replies
View Related
Mar 4, 2011
I am trying to generic way to convert the string datatype to other primitive data type. To achieve, i used Template . But i getting error and couldn't resolve the issue and error reported is also clueless.
Code
====
#include <vector>
#include <iostream>
#include <string>
[Code].....
View 7 Replies
View Related
Aug 27, 2010
How can I change the automatic fsck execution at boot time to be above 30 boots? I reboot the system sometimes 3 to 4 times a day. Intel 3 GHz, tower, i386 lenny vmlinuz-2.6.31-686
View 2 Replies
View Related
Nov 20, 2010
ive tried uninstalling it in software sources and in synaptic package manager and ive deleted the .wine folder and all files associated with the program im trying to get rid of except its .iso's which i put in a new folder and ive deleted all the drives i made in winecfg that i needed to run my program and ive tried sudo apt-get wine purge1.3 but its still the 4 wine folders are still there in menu editor and can still partially run the program im trying to get rid of and when i restart its back to the begginning
View 5 Replies
View Related
Mar 14, 2011
Is there any way not to type password each time I use synaptic or sudo?
View 6 Replies
View Related
Aug 15, 2011
I want to recompile apache so I can select a different MPM compile time option. I have looked in the graphical application manager, but I don't see a development version of apache like you do for many of the packages. Am I not looking in the right place for the source code for the Apache 2.2.17 available with FC14?
Alternatively, I can download the source from apache.org for 2.2.17. However, the install options default to a host of different directories than the FC14 version does. Being somewhat OCD I hate to mess up my FC14 system by installing to a bunch of anomalous directories, and I don't want to break anything. I can change the default install directories, if I knew what the FC14 apache 2.2.17 was compiled with. There is an httpd-devel-2.2.17-1 package. But the description makes it sound like it is for developing additional modules. I want to recompile the main httpd-2.2.17-1 package. Does anyone know if this is a possibility?
View 3 Replies
View Related
May 23, 2010
Four alike webcam active on one desktop I am running:
Quote:
0.000000] Linux version 2.6.32-22-generic (buildd@rothera) (gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) ) #33-Ubuntu SMP Wed Apr 28 13:27:30 UTC 2010 (Ubuntu 2.6.32-22.33-generic 2.6.32.11+drm33.2)
Quote:
0.085125] CPU0: Intel(R) Atom(TM) CPU 230 @ 1.60GHz stepping 02
0.176037] Brought up 2 CPUs
0.176297] CPU0 attaching sched-domain:
[code]....
Does this meet the required 4 ports mentioned for alike cameras in the forum posting. If not, I have one of these.. Is this what they are talking about. I have just started thinking about this again and am not sure if I'm asking the right question. I don't want to go buying a bunch of hardware I can not use. So I'm hoping to look to someone here who has some experience in live streaming audio / video to one of the distribution sites.
View 2 Replies
View Related
Oct 4, 2010
Are there any possible options to archive this w/ the 2.6.34 kernel? I know windows can do this w/ a button and BSD can drop packets when connected to closed ports...is IP personality usable in 2.6? Do I need work-arounds? any more options??Currently I've managed to @%#$ my OS fingerprints so results won't show as Linux.4/2.6...etc, but the problem is.. instead it's got the word "Redhat" in it (which is well... worse... because now.. if someone looks at my machine he/she'll know I am on either RHEL/Fedora )
View 14 Replies
View Related
Feb 8, 2010
I have read a couple of articles on how dynamic linking works (those stuff about got, plt and lazy binding), and I am still not sure why you need to do dynamic linking in such a complicated way.Suppose your program uses a function in a shared library that needs to be linked dynamically at run time (like a printf). Why can't you statically decide the virtual address of the function at compile time? After all, all you need to do is to enter the page table entry corresponding to the address of the function if the library has been already loaded to a physical page frame.
View 3 Replies
View Related
Apr 28, 2011
I'm using Ubuntu 10.10, with a wireless HP j4680. That prints on occassion. I've tricked it once by creating a new printer System/Admin/printers, setting the "new" printer to default then deleting the old printer. Not working that way this time. I've search the old forums, a lot of activity in 2007-2008 but nothing since.
Is there a way to defeat HP's efforts to force it's customers to purchase the extremely high, close to 50.00 dollars in my area.
View 4 Replies
View Related
Mar 2, 2011
I am using Debian linux. I have 100 timers running. If a timer expired which will generate a signal and it was mapped to a same function handler. All the timers are mapped to one function handler. The problem is if the timer expires one at a time, the function handler called at a time. But if the 2 timers expires at a time, the function handler is called one time only instead 2 times. Is it possible to invoke the function handler as many times based on timer expirary happens simultaneoulsy?
View 14 Replies
View Related
Jun 9, 2010
Is there a way to get the current time as provided from NTP (not the currently set time on the server)?
View 4 Replies
View Related
Jan 12, 2010
I am trying to set time using settimeofday in linux. But it sets local time. i.e works like SetLocalTime in windows. But I want to set system time(like SetSystemTime in windows). I could'nt find no other api in linux. What should i do? I had tried with mktime/gmtime apis
View 3 Replies
View Related
Sep 13, 2014
I want to make a little script/program/something that can organize my TV show collection. I'm italian, so I store for each episode the .mkv file and the .srt file. To let VLC automatic recognize the .srt file, I use the same name for the .mkv and the .srt.
That solution is quite optimal, but we can do better: a program that watches a directory and it's subdirectories and automatically runs mkvmerge if it detects files with the same name in the same folder.
I'm a Java programmer, so I can easily make a program that finds files with the same name and runs mkvmerge.... My problem is the directory listener. I found incron, but the problem is that it don't add the listeners to the subfolders of a folder.
View 3 Replies
View Related
Apr 12, 2010
I want to connect to anothere server from my current server through SSH command.
when I am using the command in the terminal like-- ssh username@ip it is asking me to give password. This is working fine in the terminal. but I want to do it automatic through a shell script.
How can I be able to provide userid and password through shell script?
I was trying to achieve it by creating a public key and copy it to the destination .ssh file. but I dont have the permission to create any file in the destination server.
View 2 Replies
View Related
Mar 27, 2011
I need to come up with a script that restarts every month, and sends out a reminder 5 days before the end of the month to all customers on the list with rentals. After 10 days, if their name hasn't be deselected, it will send out a last notice email to remind them of their contract and yada yada. I'm not sure if a web-based script (php) would be better, or a "regular" language like python or something.
View 1 Replies
View Related
Jul 1, 2010
In C++ what does the suffix, "*" mean appended to a variable type, e.g., "char* variable1;"?
View 3 Replies
View Related
Nov 29, 2010
I have included fstream in my file (#include <fstream>) In the file, I have a class declaration and a private variable static fstream fileStopWatch; Then I am getting the error "'fstream' does not name a type" It was working in gcc version 4.1.2 20080704 (Red Hat 4.1.2-48) but not working in gcc version 4.4.4 (GCC)
[Code].....
View 2 Replies
View Related
Apr 22, 2010
I am following this tutorial:But I just can't get it to compile. What do you think is wrong?
Code:
$ nasm -f elf -o loader.o loader.s
[michael:test]$ gcc -o kernel.o -c kernel.c -Wall -Wextra -nostdlib -nostartfiles -
[code]....
View 14 Replies
View Related
Oct 18, 2010
I had to make for work a collectd based network monitoring system which displays data for each server in a fullscreen conky on different compiz viewports. I have to switch viewports automatically when the machine isn't operated (sorta screensaver) and also if i had to call attention in the case something bad happens, autoswitching should stop and the relevant viewport be showed up.This requires an interface to talk dynamically to the WM, which i've implemented in bash with support of the widely available "wmctrl" program.
Code:
http://paste2.org/p/1177045
Code:
[code]...
View 8 Replies
View Related
Jun 14, 2010
I declared a variable as int data type which was a placeholder for a resulttatus (meaning, based on the result status that variable varies from 0/1/2/3. It can contain only these four values).data type is 4 byte integer in C#. But I can declare this variable as which represents a 1 byte integer. Since that variable contains only 1 or 2 or 3 or 4, declaring the variable asis wastage of memory space.Before declaring any variable we need to just think of the memory space needed for that variable, our requirement,
View 6 Replies
View Related
Jun 26, 2010
I'm quite new to c++ programming, so my concepts are not so increased yet...
I wanna to create a list to store my objects. I'll resume them here:
Code:
private:
And what I want to do is an event list:
Code:
Sometimes this works and sometimes I got "segmentation fault".
I think I'm doing it wrong, cause these objects have different sizes, so I don't know if I could have all of them in a single array.
View 8 Replies
View Related
Jun 13, 2011
I have a C header file which have arrays of predefined(known) structure type. But i dont have names of arrays and their size. when i include that file and compile my application, i want to know the names and sizesof those arrays.
purpose of application is to get the content of those arrays and to explain it in descriptive words instead of hex numbers.ofcourse this can be done by file pointers and reading also with out header file inclusion, but as i am working in C, once compiled, those variables are in my address space in i include header file.
View 5 Replies
View Related