FAQ Database Discussion Community


Type 'interrupt' attribute only applies to functions [-Wattributes] when using typedef function pointer

pointers,gcc,attributes,warnings,interrupt
I have the following line of code: typedef void(* foo)(void) __attribute__ ((interrupt)); When using LPCXpresso to compile the project I get a compiler warning: Type 'interrupt' attribute only applies to functions [-Wattributes] Could anyone give me a hint on how to fix this warning? ...

R execude expression on warning/error

r,warnings
I process huge data sets and therefore my R program runs for several hours. Sometimes it happens that something goes wrong and the program aborts with some warning/error message. Most times this are not the warning messages I programmed myself because I thought on what could go wrong - it...

Try catch not working in PHP?

php,debugging,warnings
I'm working on web-service. I'm trying to catch error. My problematic code is: try { $query = "UPDATE Users SET Latitude=?, Longitude=?, Address=?, LocationTimestamp=? WHERE Id=?"; $stmt = $this->link->prepare($query); $stmt->bind_param('ddssi', $Latitude, $Longitude, $Address, $LocationTimestamp, $Id); $stmt->execute(); $affected_rows = $stmt->affected_rows; } catch(Exception $exc) { file_put_contents("log/error.txt",$exc->getMessage()); } I expected, that catch block...

Why is GTK spewing a ton of (seemingly) irrelevant warnings?

c,gtk,warnings
Here is a very simple GTK application that creates an application indicator: #include <gtk/gtk.h> #include <libappindicator/app-indicator.h> int main() { AppIndicator *indicator; GtkWidget *menu; GtkWidget *item1; GtkWidget *item2; GtkWidget *separator; indicator = app_indicator_new("testapp", "distributor-logo", APP_INDICATOR_CATEGORY_APPLICATION_STATUS); menu = gtk_menu_new(); app_indicator_set_menu(indicator, GTK_MENU(menu)); app_indicator_set_status(indicator, APP_INDICATOR_STATUS_ACTIVE); item1 =...

In C++ float value being truncated from double

c++,oop,double,warnings,truncation
I've coded using float variables before and never had this problem. float a, b, subtotal, stx; a=15.95; b=24.95; subtotal=a+b; stx=subtotal*.07; cout << "Item 1: $" << a << endl; cout << "Item 2: $" << b << endl; cout << "\nSubtotal: $" <<subtotal<< endl; cout << "Sales Tax: $" <<...

How can a “missing concrete implementation” warning be suppressed?

dart,warnings
What can I do to prevent the compiler from throwing the following warning Missing concrete implementation of setter 'MyClass.field' and getter 'MyClass.field' on the following code? import 'package:mock/mock.dart'; class MyClass { String field; } @proxy class MockMyClass extends Mock implements MyClass{} ...

Warning: preg_match_all(): Unknown modifier '\' [duplicate]

php,regex,warnings
This question already has an answer here: PHP - preg_match and “Unknown modifier” error 3 answers I know there are tons of duplicate question like this. But I am stuck here. Can anyone help me out? Here's the code: <?php function count_images($string){ preg_match_all('/[^/\s]+/\S+\.(jpg|png|gif)/', $string, $results); return count($results[1]); } ?>...

Passing argument 2 of sprintf makes pointer from integer without a cast. C warning

c,warnings
char temp_fname[OSCAR_MAX_FILE_NAME_LEN+1]; char temp_fname_len[2+1]; char temp_cdate[OSCAR_DATE_SIZE+1]; struct stat st; sprintf(temp_fname, OSCAR_MAX_FILE_MNAME_LEN+1, "%-30s", argv[i]); sprintf(temp_fname_len, 3, "%-2u", (int)strlen(argv[i])); sprintf(temp_cdate, OSCAR_DATE_SIZE+1, "%-12u", (unsigned int) st.st_ctime); I've included stdio.h and string.h. What should I do to fix this? Please let me know if I need to add more information about the code....

How to receive MYSQL warnings (E.g. #1264 Out of Range) from PHP PDO

php,mysql,pdo,error-handling,warnings
while I am working with PHP PDO I noticed that I can change the ERROR MODE to Exceptions. But what if I need to know the MYSQL WARNINGS as well. Example: update <table> SET number = 99999999999 should cause MYSQL to throw the below warning when number is an int(11)...

Perl wrongly complaining about Name “main::FILE” used only once

perl,file,warnings
I simplified my program to the following trivial snippet and I'm still getting the message Name "main::FILE" used only once: possible typo... #!/usr/bin/perl -w use strict; use autodie qw(open close); foreach my $f (@ARGV) { local $/; open FILE, "<", $f; local $_ = <FILE>; # <--- HERE close FILE;...

Static cast of enum to bool, performance warning from Compiler

c++,casting,enums,warnings,static-cast
I have the following declared in my project: enum class OType : bool { Dynamic=true, Static=false }; OType getotype(); I'm using the following function: double ComputeO(double K,bool type) I'm calling it this way : ComputeO(some double, static_cast<bool>(getotype())) For this static_cast I'm getting a nice: warning C4800: 'const dmodel::OType ' :...

warning: Wlogical-not-parentheses

c++,g++,warnings
I am confronted with a problem of a few days. I receive this warning when compiling my program. In member function 'void CClientManager::RESULT_SAFEBOX_LOAD(CPeer*, SQLMsg*)': 661:25: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses] if (!dwSkillVnum > 120) ^ And another warning : 661:25: warning:...

find code causing warning 4503 in VC++

c++,debugging,visual-studio-2012,warnings,pragma
I'm trying to track down the source of this large warning in a big code base: C:\Program Files (x86)\Microsoft Visual Studio 12.\VC\INCLUDE\xmemory0(592) : warning C4503: 'std::_Tree<std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,false>>::_Insert_at' : decorated name length exceeded, name was truncated with [ _Kty=epmem_node_id, _Ty=std::map<std::string,std::list<std::string,std::allocator<std::string>>,std::less<std::string>,std::allocator<std::pair<const...

Getting Error - Warning: Missing argument 1 for DbQuery::__construct()

php,database,warnings
I am using the following code to for creating connection to database. But is giving me error as Warning: Missing argument 1 for DbQuery::__construct(); Kindly give me the solution and point me out with my mistake. Following is my code: core.php //Database connection class DbQuery{ public $conn; private $host; private...

Can I Promote Notes About Uninitialized Variables to Errors

error-handling,sas,warnings
When SAS encounters an uninitialized variable, it will output a note to the log that looks like this: NOTE: Variable not_in_data is uninitialized. Is it possible to have SAS output that message as a warning or an error instead?...

How to reset warnings completely

python,pandas,warnings
How can I see a warning again without restarting python. Now I see them only once. Consider this code for example: import pandas as pd pd.Series([1]) / 0 I get RuntimeWarning: divide by zero encountered in true_divide But when I run it again it executes silently. How can I see...

Why cppcheck tool does not find uninitialized variable?

c++,initialization,warnings,cppcheck
I run commad (Ubuntu 12.04) cppcheck test.cpp I am expecting uninitialized variable warning from cppcheck tool. Why cppcheck tool does not print it on the command line? Example cpp code: #include <iostream> class Foo { private: int m_nValue; public: Foo(); int GetValue() { return m_nValue; } }; Foo::Foo() { //...

PHP Warning: file_get_contents(http://ipecho.net/plain): failed to open stream: Connection timed out in

php,warnings,file-get-contents
I have an error here and I don't know where the problem is exactly. I am trying to make a PHP file and deny anyone to use the script except the IP that I have entered into the code: $pass = '192.168.x.x'; //here is the ip of the client if...

How do I print out Integeral values in haskell without warning using show?

haskell,warnings,show,ghci,integral
When I run the following haskell code with warnings enabled module Main where main :: IO() main = interact (unlines.strout.calc.extinps.words) --calculates factorial factorial :: Integral a=> a->a factorial n = product [1..n] --Extracts numbers from the input extinps ::(Read b)=>[String]->[b] extinps x=map read x --Calculates the factorial calc :: (Integral...

warning : Implicit declaration error [duplicate]

c,include,warnings
This question already has an answer here: warning: implicit declaration of function 2 answers Here's the files , i want to use includes : primitives.h: #ifndef PRIMITIVES_H_ #define PRIMITIVES_H_ #include "bloc.h" #endif primitives.c #include "primitives.h" Bloc_T creat2(char* ,BT_T); Bloc_T creat2(char* nomfic ,BT_T typefic) { Bloc_T Nouv_Bloc; setTitreMeta(Nouv_Bloc.infosFic,nomfic); Nouv_Bloc.typeBloc= typefic;...

Expected type 'Union[ndarray, Iterable]' warning in Python instruction

python,numpy,warnings,translate
I have translated a Matlab function to create an Overcomplete Discrete Cosine Transform matrix to represent 1D signals in such vectorial space, to Python language. Matlab Function function D = odctdict(n,L) %ODCTDICT Overcomplete DCT dictionary. % D = ODCTDICT(N,L) returns the overcomplete DCT dictionary of size NxL % for signals...

gcc warning flag at the end of warning output. what does it mean?

c++,c,gcc,g++,warnings
I want to know what does the warning flag at the end of warning statement (in compilation output) shows ? e.g in this code #include <stdio.h> int g_var = 'ghij'; int main(void) { fprintf(stderr," g_var = %d " , g_var); return 0; } when compiled with gcc temp.c compilation shows...

perl: why does $hashsize = keys $hash{$foo} give experimental warning, and how can I write it better?

perl,hash,warnings
I have a hash determined by two factors (I don't know what the correct term for this is), which I generate like so: if (exists $cuthash{$chr}{$bin}){ $cuthash{$chr}{$bin} += 1; }else{ $cuthash{$chr}{$bin} = 1; } I later want to grab the size of each $chr portion of the hash, which works...

How do I get rid of the NOTE's generated by R CMD check when using for example ddply in my package?

r,warnings,plyr,r-package,package-development
I have a problem similar to, yet distinct from, How can I handle R CMD check "no visible binding for global variable" notes when my ggplot2 syntax is sensible?. In that scenario everything works smoothly by using aes_string instead of aes. However, this is not possible with plyr afaik. The...

Trying to get property on a non object Yii 1.1.15

php,yii,warnings
I try to change Css file for CGridView widget, in my config/main.php: 'components' => array( 'widgetFactory' => array( 'widgets' => array( 'CGridView' => array( 'cssFile' => Yii::app()->request->baseUrl . '/css/gridview.css', ), ), ), ... And I get warning: Trying to get property on a non object /path_to_project/protected/config/main.php on line 79 How...

How to solve the error “assignment makes integer from pointer without a cast”?

c,linked-list,warnings,dev-c++
Here is the piece of code: I wonder where my mistake is? I have a structure named country, working with linked lists, and here is my function for searching: country *search(char *v) { country *c; c=head; while(c) { if(strcmp(c->name,v)==0) {return c;} c=c->next; if(c==head) break;} return (void *)-1;} In main I...

using Eval of ASP Listview as an inline CSS value

asp.net,listview,warnings,eval
my code is : <asp:ListView ID="lst1" runat="server"> <ItemTemplate> <div style="width:<%#Eval("Rating")%>%"> </div> </ItemTemplate> </asp:ListView> It works great, but in VisualStudio editor it's considered as invalid. Is there any way to make it valid? I know that I can create the whole ' style="width:xxx%" ' in the Eval but I'm looking for...

How can I avoid unchecked method warnings in Java when I don't know the type of a generic object?

java,generics,warnings,unchecked
I am new to using Java Generics and am wondering how I should go about getting rid of unchecked method warnings. I understand that code like this specifies the type of the generic object and doesn't give me warnings: DTRowData<String> someData = new DTRowData<String>("Some string"); But I won't know the...

Segmentation fault (core dumped) in C program

c,segmentation-fault,initialization,warnings
I have the following program: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 255 char * decrypt(char *p, int key){ char *tmp; for(int i = 0; p[i] != '\0'; i++){ tmp[i] = p[i]-key; } return tmp; } int main(void){ printf("Hallo Welt!"); printf("%s\n", decrypt("ibmmp", 1)); return EXIT_SUCCESS; } When I compile...

PerformSelector may cause a leak - Better solution

ios,objective-c,xcode,warnings
I have a custom BackBarButton where i have a property to store a selector which can change in some cases. So i can't use delegatoion really smoothly. What can i do to get rid of this warning without changing the 'workflow' to delegation? The property is defined by using this:...

Unable to determine compiler to use - the abstract compiler specification is missing from this Xcode installation

xcode,warnings,rule
Hi I have iMac with OS X Yosemite version 10.10.3 and I've installed the last Xcode 6.3 beta 2 with Swift 1.2 and when I try to Run the App I receive: Check dependencies Unable to determine compiler to use - the abstract compiler specification is missing from this Xcode...

Change Android Eclipse settings to ignore error

java,android,eclipse,compiler-errors,warnings
I reverse engineering an apk file and I edit some stuff in java files, and it gives me lot of errors BUT BEFORE THAT, I have already tested the original java files and resources from the apk that I reverse engineering without making any edit but it gives me the...

“More than one element found for locator” warning

angularjs,testing,warnings,protractor,end-to-end
In one of my tests, I'm locating an element using a CSS selector: element(by.css("ul.nav button")) There is more than one element matching the query, but, since I need only the first one, I'm okay with the selector. The problem is, protractor throws a warning: WARNING - more than one element...

Why is my data being truncated? Warning | 1265 | Data truncated for column

mysql,date,null,warnings,truncated
I tried adding NULL to both date_of_birth and date_of_death, but that didn't help. Why is data being truncated? (especially because there isn't any data at the moment...) Also, I don't understand warning 1261 at all. Row 5 is no different from rows 1-4. Thanks! The following script: -- create the...

Prevent ObsoleteAttribute warning bubbling up call stack

c#,visual-studio,warnings,compiler-warnings,suppress-warnings
I have a class using a deprecated assembly (System.Data.OracleClient). At compile time this results in a message 'MethodName()' is obsolete: 'OracleConnection has been deprecated. We can't replace this assembly and we are now trying to remove all warnings generated at compile time so that new warnings are clear to us....

strange warning on my tests

python,django,warnings,translation
I installed a "third party app" named rosetta on my project for manage my translations more "systematic" way from this command: sudo easy_install django-rosetta I don't have any problem with rosetta, i can manage my translations very well with its interface but i have been watching at my console that...

Python RuntimeWarning overflow encountered in double_scalars

python,c,numpy,overflow,warnings
I'm trying to port a "C" code to Python, this is what I coded: scale = 1.0 / (rows * cols) RemoveConstantBiasFrom(rarray, scale) zarray = rarray[:] zarray = DCT(zarray, rows, cols) zarray = zarray.flatten() beta = np.dot(rarray, zarray) if iloop == 0: parray = zarray[:] else: btemp = beta /...

IE8 issue with Bootstrap 3 and testing in IE emulation modes

twitter-bootstrap-3,internet-explorer-8,warnings,ie8-compatibility-mode
I'm creating a website with Bootstrap 3.3.2 and on IE8 I have this alert displaying every time I refresh or change page : WARNING: You appear to be using IE8 in IE7 emulation mode. IE emulation modes can behave significantly differently from ACTUAL older version of IE. PLEASE DON'T FILE...

Warnings 5 and 32 on first two files while renaming all files in a directory

php,image,warnings,file-rename
I made a simple image renaming application. It adds a number serially after every image name to distinguish one from another. But the problem is that, when this PHP application runs I get two warnings and I think for this reason $i value is starting with 3, like image 3,...

How to properly declare a friend of a nested class of a template class?

c++,templates,warnings
When I do the following: template <typename T> class Container { public: class Iterator { friend bool operator==(const Iterator& x, const Iterator& y); }; }; gcc gives me the following warning and suggestion: warning: friend declaration 'bool operator==(const Container<T>::Iterator&, const Container<T>::Iterator&)' declares a non-template function [-Wnon-template-friend] friend bool operator==(const Iterator&...

How to get rid of Suspicious call warning on Android Studio?

java,android,button,casting,warnings
In my code I have an ArrayList<Buttons> field named mButtons. Each of these buttons invoke (in XML) the same onClick function onButtonClick. The function looks like this: public void onButtonClick(View view) { int buttonIndex = mButtons.indexOf(view); } But Android Studio keeps warning me about a Suspicious call to 'ArrayList.indexOf'. Ok,...

No extra Boolean cast in JavaScript

javascript,boolean,warnings,lint
In if statement's casting to a Boolean via double negation (!!) is unnecessary, because these if statements, for example, are equivalent: if (!!foo) { // ... } if (foo) { // ... } But what if casting to a Boolean via !! is in return statement? Like here: nameToSomething :...

C table initialisation

c,table,warnings
I want to intialise a table that should contain a few chars for comparing it to values later, this is my code: char z[8] = {' ', '.', '\', ':', 'o', '&', '8', '#', '@'}; I get a bunch of error messages from the compiler tho, some are: dn08.c: In...

Malloc vairables in seperate function results in “uninitialized in this function”

c,variables,malloc,warnings,compiler-warnings
Trying to simplify my code and I thought I'd be smart by mallocing all the variables in a function in a seperate function to remove big code chunks. However when I try to malloc some variables, the compiler returns: warning: ‘roomString’ is used uninitialized in this function [-Wuninitialized] Heres the...

PHP Session Errors and Warnings [duplicate]

php,session,syntax-error,warnings
This question already has an answer here: How to fix “Headers already sent” error in PHP 12 answers I am trying to check whether a user is logged in or not on the index.php page. If user is not logged in I want to redirect the user to login.php...

Warnings in R - making note

r,warnings
I'm trying to run a function (glm) in R 1000 times (with slightly different inputs each time). Sometimes I'll get a warning (because separation occurs) - all I want to do is count how many times this occurs (so how many times in the 1000 iterations I get the warning...

warning: incorrect argument passed to function

php,cakephp,warnings,cakephp-3.0
I have a function beforeMarshal () located in ModelTable.php. This function executes correctly before the request data is saved however I get php warnings each time the data is saved. public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) { $ip = $data['ip']; $data['iplong'] = ip2long($ip); } Warning (4096): Argument 1...

Too many warnings on a C macro

c,gcc,macros,warnings
I'm trying an approach to flag warnings on my code, but I did some mistake and can't understand where. My compiler gives me too much warnings about each use of this macro: #define MPL_ERROR_MESSAGE2(output, fmt, ...) fprintf(output, ("\n[ERROR][%s:%d( %s )]\n--- " fmt " ---\n\n"), __FILE__, __LINE__, __PRETTY_FUNCTION__, ##__VA_ARGS__); #define MPL_ERROR_MESSAGE(fmt,...

Log stack trace for python warning

python,logging,warnings,stack-trace
A package that I'm using in my python program is throwing a warning that I'd like to understand the exact cause of. I've set logging.captureWarning(True) and am capturing the warning in my logging, but still have no idea where it is coming from. How do I also log the stack...

Unchecked warnings are not removed with Javac @SuppressWarnings annotation

java,compilation,warnings,javac,compiler-warnings
I cannot remove my warnings with unchecked cast. I believe this is very strange because I have added the @SuppressWarnings("unchecked") annotation on the method but the Javac still showing the warnings. [unchecked] unchecked cast (List<Integer>) getObject(LIST); return (List<Integer>) getObject(LIST); required: List<Integer> found: Object I have create an Example, It throws...

Is it possible to get a “use of uninitialized local variable” warning in Visual Basic?

c#,vb.net,warnings,variable-declaration
Compare the following snippets: static void Main(string[] args) { int i; Console.Write(i); // yields an error: Use of unassigned local variable 'i' } Public Sub Main() Dim i As Integer Console.Write(i) ' no warning End Sub Public Sub Main() Dim s As String Console.Write(s) ' yields a warning: Variable 's'...

ASP.NET DataSet Queries - Warning is causing DataSet to not fill correctly

asp.net,ms-access,dataset,warnings,modulus
I've created a DataSet in ASP.NET and replaced the default Fill query with the following SQL statement: SELECT Resolved_Request.ResolvedReqID, In_Progress_Request.DateAssigned, Resolved_Request.DateResolved, Fix(((DATEDIFF('n', In_Progress_Request.DateAssigned, Resolved_Request.DateResolved) / 60 / 24))) & ' days, ' & ((DATEDIFF('n', In_Progress_Request.DateAssigned, Resolved_Request.DateResolved) / 60) Mod 24) & ' hours and ' & (DATEDIFF('n', In_Progress_Request.DateAssigned, Resolved_Request.DateResolved) Mod...

Fortran runtime warning: temporary array

fortran,warnings,gfortran,temporary
I get the fortran runtime warning "An array temporary was created" when running my code (compiled with gfortran) and I would like to know if there is a better way to solve this warning. My original code is something like this: allocate(flx_est(lsign,3)) allocate(flx_err(lsign,3)) do i=1,lsign call combflx_calc(flx_est(i,:),flx_err(i,:)) enddo Inside the...

Perl argument “user” isn't numeric in array element

arrays,perl,arguments,warnings,numeric
I always get the message that my argument in array isn't nummeric. It happens 5 times in this little code: my $mcnamequery = "SELECT mcID FROM tblMCName WHERE mcName = '".$mcname."'"; $mcid = dbSelect($mcnamequery); print $mcid->{mcID} . "\n"; my $userfsquery = "SELECT userFS FROM tblMcSubs WHERE mcFS = '".$mcid->{mcID}."'"; my...

Why is there not any warning on a declaration without initialization in a for loop?

c++,initialization,g++,warnings,declaration
I tried to compile the following code using g++ (gcc version 4.8.2 (Debian 4.8.2-1)), with -Wall flag (adding the -Wextra flag does not change anything for me). #include <iostream> using namespace std ; int main() { int i ; cout << i << endl ; } It gave this warning:...

Redirect to a 3rd party HTTP page from HTTPS without the certificate error

java,jsp,security,https,warnings
We have a web application. Our homepage is in HTTPS. When a user clicks a link to go to the content provider's website (where HTTPS is not yet enabled), we get the following error image. Any ideas to circumvent this? Our view is a JSP which posts to the 3rd...