Solved

warning: passing arg 1 of `my_encryptIDEA` from incompatible pointer type

Posted on 2008-10-30
2
407 Views
Last Modified: 2012-08-14
Hi,

I class myself as a noob (I guess you will agree when you see me code :) So please be gentle....

I have the following code that once I read my config file in, I want to encrypt the password etc. I am using sfl code from http://legacy.imatix.com/html/sfl/sfl.htm
When I compile, using gcc on solaris, I get the following warning: passing arg 1 of `my_encryptIDEA` from incompatible pointer type. Please could someone explain why and how to correct? Thank you.


const char *

my_encryptIDEA(char *buffer[])

{

	char

		key [] = "100110110111011010110";

	int

		len;
 

	len = strlen(buffer);
 

	if (crypt_encode ((byte *)buffer, (long) len,

                           CRYPT_IDEA, (byte *)key))

	{

		return base64_encode(buffer);

	}

  else

	{

		return NULL;

	}

}
 

How it is used:

configInfo->encryptedKey = strdup(my_encryptIDEA(Parameter));

Open in new window

0
Comment
Question by:smurff
2 Comments
 
LVL 45

Accepted Solution

by:
Kdo earned 50 total points
ID: 22840807
Hi smruff,

The message is a warning that says that the function is expecting a pointer to a particular kind of object (in this case a pointer to a character array) and you're actually passing a pointer to something else (I suspect a pointer to a string).

It looks like the function doesn't really need a pointer to an array, just an array.  Try changing the header to:

  my_encryptIDEA (char *buffer)


Good Luck,
Kent
0
 
LVL 3

Author Closing Comment

by:smurff
ID: 31511646
Wow, went to lunch, came back and the answer was there. Thank you so much.
Kind regards
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
posix semaphore deadlock 13 114
C++ check and remove last word from a string 5 141
How do I install gcc 4.8.4 on a Linux Ubuntu 14.04 machine? 5 1,567
C dll call freezes 5 93
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now