12-19-2011
The problem is mainly due to you having two units of compilation and no prototypes.
If you call a function and you do not have a prototype, the compiler will infer a prototype from the parameters you pass to the function. If the function is in another compilation unit (as is your case), there's no way to get a compilation error if the type is wrong, since without a prototype there's no way to check. If the compiler gets the type wrong, you get unexpected behavior. That is what is happening in this case.
You need to create function prototypes to avoid this type of error.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hallo everyone,
This is my problem below:
/home/cerebrus/pax=>vat class2.sh
ksh: vat: not found
/home/cerebrus/pax=>cat class2.sh
#!/bin/ksh
set -x
bdf|grep appsdev|awk '{ print $5 }'> class3
dd={cat class3}
echo $dd
/home/cerebrus/pax=>
/home/cerebrus/pax=>./class2.sh
+ bdf
+... (8 Replies)
Discussion started by: kekanap
8 Replies
2. UNIX for Advanced & Expert Users
I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in.
How can I make the function receive the whole string (and not terminate at the first space it encounters)?.
part of... (2 Replies)
Discussion started by: fastgoon
2 Replies
3. Programming
Hi,
How to pass parameter to makefile?
Please let me know if any one knows and also please put an example of makefile with this feature.
thanks,
Manju. (3 Replies)
Discussion started by: manju_p
3 Replies
4. Shell Programming and Scripting
Hi all
I have a script which will take input as filename and passes it to a java program. It is as follows
--------------------------------
FILENAME=$1
echo $FILENAME
${JAVA_HOME}/bin/java -cp DateProvider $FILENAME
-------------------------------------------------
when I execute the same... (2 Replies)
Discussion started by: malle
2 Replies
5. Shell Programming and Scripting
I have written a Shell Script Program which accepts 3 parameters as shown below:
./calc 20 + 2
in the above line ./calc is the Shell Script itself with 3 parameters, namely:
20
+
and 2.
Well, now let's look inside the Script:
result=$1$2$3
echo $result
The output will be as... (8 Replies)
Discussion started by: indiansoil
8 Replies
6. Shell Programming and Scripting
Hi All,
I developed a KSH script which will accept two parameters as input. These two parameters are some directories paths.
In the script i am validating the number of paramaters it received as below
#--------------------------------------
# Check Command line arguments... (8 Replies)
Discussion started by: Raamc
8 Replies
7. Shell Programming and Scripting
Hi All,
When passing parameters to a sheel script, the parameters are referenced by their positions such as $1 for first parameter, $2 for second parameter. these positional values can only have values ranging from $0-$9 (0,1,2,3...9).
I have a shell script meant to accept 20 parameters. for... (3 Replies)
Discussion started by: ogologoma
3 Replies
8. Shell Programming and Scripting
i am passing input parameter 'one_two' to the script , the script output should display the result as below
one_1two
one_2two
one_3two
if
then
echo " Usage : <$0> <DATABASE> "
exit 0
else
for DB in 1 2 3
do
DBname=`$DATABASE | awk -F "_" '{print $1_${DB}_$2}`
done
fi (5 Replies)
Discussion started by: only4satish
5 Replies
9. Shell Programming and Scripting
Hi,
I've written a script where eleven parameter to be passed from command line
which is inserting into an oracle table,
it is working but the tenth and 11th parameter are not accepting as given
it is referring to 1st parameter.
HERE IS THE SCRIPT
#!/bin/ksh
#set -o
echo $*... (4 Replies)
Discussion started by: sankar
4 Replies
10. Shell Programming and Scripting
Hi ,
I am passing date parameter through file
my shell script testing.sh is
#set -x
#set -v
asd=$1
asd1=$2
echo $asd
echo $asd1
Passing parameter as below
sh testing.sh `cat file1.txt`
Output (2 Replies)
Discussion started by: kaushik02018
2 Replies
LEARN ABOUT MOJAVE
mpscnnneuronpowernode
MPSCNNNeuronPowerNode(3) MetalPerformanceShaders.framework MPSCNNNeuronPowerNode(3)
NAME
MPSCNNNeuronPowerNode
SYNOPSIS
#import <MPSNNGraphNodes.h>
Inherits MPSCNNNeuronNode.
Instance Methods
(nonnull instancetype) - initWithSource:a:b:c:
(nonnull instancetype) - initWithSource:
Class Methods
(nonnull instancetype) + nodeWithSource:a:b:c:
(nonnull instancetype) + nodeWithSource:
Additional Inherited Members
Detailed Description
A node representing a MPSCNNNeuronPower kernel For each pixel, applies the following function:
f(x) = (a * x + b) ^ c
Method Documentation
- (nonnull instancetype) initWithSource: (MPSNNImageNode *__nonnull) sourceNode
Init a node with default values for parameters a, b, and c
- (nonnull instancetype) initWithSource: (MPSNNImageNode *__nonnull) sourceNode(float) a(float) b(float) c
Init a node representing a MPSCNNNeuronPower kernel For each pixel, applies the following function:
f(x) = (a * x + b) ^ c
Parameters:
sourceNode The MPSNNImageNode representing the source MPSImage for the filter
a See discussion above.
b See discussion above.
c See discussion above.
Returns:
A new MPSNNFilter node for a MPSCNNNeuronPower kernel.
+ (nonnull instancetype) nodeWithSource: (MPSNNImageNode *__nonnull) sourceNode
Create an autoreleased node with default values for parameters a, b, and c
+ (nonnull instancetype) nodeWithSource: (MPSNNImageNode *__nonnull) sourceNode(float) a(float) b(float) c
Author
Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code.
Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSCNNNeuronPowerNode(3)