Sponsored Content
Top Forums Programming -Warray-bounds option to GCC compiler Post 303013095 by hicksd8 on Wednesday 14th of February 2018 10:29:14 PM
Old 02-14-2018
What level of optimization are you using?

Try at least level -O2 and it will probably catch it. Without at least that level the compiler doesn't do enough work to detect out-of-bounds but it should still detect it at run-time.

Last edited by hicksd8; 02-15-2018 at 09:15 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cc compiler / gcc

:confused: I have a question concerning gcc. IŽd like to install the gcc on my Mac OS X, but when I try to run the configure command I get the following message: floriant% ./configure ./configure: read-only variable: PWD Configuring for a powerpc-apple-darwin5.4 host. *** This configuration... (2 Replies)
Discussion started by: florian.turck
2 Replies

2. Programming

gcc compiler

i write c++ code it run perfectely with g++ compiler but same code when i compile with GCC compiler it gives linker error , followed these linker error /tmp/ccfZtXOQ.o(.text+0x22): In function `main': conf_system.cpp: undefined reference to `operator new(unsigned int)'... (5 Replies)
Discussion started by: munnu
5 Replies

3. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

4. AIX

AIX 5.3 gcc compiler

Hi there I've got a problem getting my mysql libraries to work. every time I compile my source code it gives my a compiler error. Cannot find a rule to create target /usr/include/mysql/mysql.h AND /usr/include/mysql/mysql.h: Permission denied Is anyone fimiliar with this error, and can... (1 Reply)
Discussion started by: cipher#1
1 Replies

5. Ubuntu

gcc compiler

where to download gcc compiler for ubuntu? how to install? how to build and run "c programs"? screen shots if possible.....:b::D tutorials too:cool: (5 Replies)
Discussion started by: villanarun
5 Replies

6. Shell Programming and Scripting

gcc compiler

I am using open suse linux. I want to install gcc compiler in my machine. I ahve checked man gcc and man cc. But it's not there. Can someone help me (4 Replies)
Discussion started by: pritish.sas
4 Replies

7. Programming

gcc compiler

Which gcc compiler release had the Arm 9 multicore support?Whether the compiler that used for the single Arm 9 core can be used for its multicore systems ? If gcc not support,please tell me which are the compilers that are available for Arm 9 multicore systems (including commerical).Whether... (0 Replies)
Discussion started by: sujith4u87
0 Replies

8. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

9. Programming

A question regarding the gcc compiler ...

It might be a simple one but I have this question bothering me for sometime. When we do a symbol search inside the library directory (i.e. /usr/lib/*) via tools like nm; it takes a while to give us the results. However, its very quick when gcc is invoked to compile a program with the very same... (11 Replies)
Discussion started by: Praveen_218
11 Replies
pm_power_has_changed(9F)                                   Kernel Functions for Drivers                                   pm_power_has_changed(9F)

NAME
pm_power_has_changed - Notify Power Management framework of autonomous power level change SYNOPSIS
#include <sys/ddi.h> #include <sys/sunddi.h> int pm_power_has_changed(dev_info_t *dip, int component, int level); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI) PARAMETERS
dip Pointer to the device dev_info structure component Number of the component that has changed power level level Power level to which the indicated component has changed DESCRIPTION
The pm_power_has_changed(9) function notifies the Power Management framework that the power level of component of dip has changed to level. Normally power level changes are initiated by the Power Management framework due to device idleness, or through a request to the framework from the driver via pm_raise_power(9F) or pm_lower_power(9F), but some devices may change power levels on their own. For the framework to track the power level of the device under these circumstances, the framework must be notified of autonomous power level changes by a call to pm_power_has_changed(). Because of the asynchronous nature of these events, the Power Management framework might have called power(9E) between the device's autono- mous power level change and the driver calling pm_power_has_changed(), or the framework may be in the process of changing the power level when pm_power_has_changed() is called. To handle these situations correctly, the driver should verify that the device is indeed at the level or set the device to the level if it doesn't support inquirying of power levels, before calling pm_power_has_changed(). In addition, the driver should prevent a power(9E) entry point from running in parallel with pm_power_has_changed(). Note - If this function is called as a result of entry into the driver's attach(9E), detach(9E) or power(9E) entry point, this function must be called from the same thread which entered attach(9E), detach(9E) or power(9E). RETURN VALUES
The pm_power_has_changed() function returns: DDI_SUCCESS The power level of component was successfully updated to level. DDI_FAILURE Invalid component component or power level level. CONTEXT
This function can be called from user or kernel context. This function can also be called from interrupt context, providing that it is not the first Power Management function called by the driver. EXAMPLES
A hypothetical driver might include this code to handle pm_power_has_changed(9): static int xxusb_intr(struct buf *bp) { ... /* * At this point the device has informed us that it has * changed power level on its own. Inform this to framework. * We need to take care of the case when framework has * already called power() entry point and changed power level * before we were able to inform framework of this change. * Handle this by comparing the informed power level with * the actual power level and only doing the call if they * are same. In addition, make sure that power() doesn't get * run in parallel with this code by holding the mutex. */ ASSERT(mutex_owned(&xsp->lock)); if (level_informed == *(xsp->level_reg_addr)) { if (pm_power_has_changed(xsp->dip, XXUSB_COMPONENT, level_informed) != DDI_SUCCESS) { mutex_exit( &xsp->lock); return(DDI_INTR_UNCLAIMED); } } .... } xxdisk_power(dev_info *dip, int comp, int level) { mutex_enter( xsp->lock); ... ... } ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Stability level |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
power.conf(4), pm(7D), attach(9E), detach(9E), power(9E), pm_busy_component(9F), pm_idle_component(9F), pm_raise_power(9F), pm_lower_power(9F), pm(9P), pm-components(9P) Writing Device Drivers SunOS 5.10 22 July 2004 pm_power_has_changed(9F)
All times are GMT -4. The time now is 11:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy