warning: data definition has no type or storage class

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

warning: data definition has no type or storage class

omronz
Hai everyone

I am new in SSL. I start to play around OpenSSL by creating a simple server that uses openssl. So, I just intialize the openssl main library but my program returned the warning message "data definition  has no type or storage class" What does this mean and how can i eliminate this warning message? Hope that anyone here can help me since I am really new in OpenSSL. My OpenSSL version is 0.9.8g 19 Oct 2007.

#include <openssl/bio.h>
//#include <openssl/ssl.h>
//#include <openssl/err.h>

OpenSSL_add_all_algorithms(); //the warning message returned here
SSL_load_error_strings();       //the warning message returned here

int main()
{
  return 0;
}

Another error i received is
- "previous declaration of 'OPENSSL_add_all_algorithms_noconf' was here"
- "conflicting types for 'SSL_load_error_strings' "

These error message above only appeared if i cancel the comment tag at the #include <openssl/ssl.h> and #include <openssl/err.h>

Hope that anyone can help me. I am now referring 3 basic manuals about openssl and these 3 gives different initialization library. Some uses  OpenSSL_add_all_algorithms(); and there are some uses SSL_library_init(). I know that by using different library, they offer different encryption and hash function example like DES or any other encryption algo. Can both of them be used using my openssl version? Thanks a lot.
Reply | Threaded
Open this post in threaded view
|

RE: warning: data definition has no type or storage class

Dave Thompson-4
> From: [hidden email] On Behalf Of omronz
> Sent: Monday, 03 August, 2009 00:41

> I am new in SSL. I start to play around OpenSSL by creating a
> simple server that uses openssl. So, I just intialize the
> openssl main library but my program returned the warning
> message "data definition  has no type or storage class" What
> does this mean and how can i eliminate this warning message?
> Hope that anyone here can help me since I am really new in OpenSSL.
> My OpenSSL version is 0.9.8g 19 Oct 2007.
>
Apparently you are new to C programming also.

> #include <openssl/bio.h>
> //#include <openssl/ssl.h>
> //#include <openssl/err.h>
>
> OpenSSL_add_all_algorithms(); //the warning message returned here
> SSL_load_error_strings();       //the warning message returned here
>
You cannot have executable statements outside of a function
body (more precisely, block) in C, so these are treated as
VERY OLD pre-"K&R1" (circa 1975) declarations with
no return type (implicit int) hence the warnings.
These should be calls (statements) INSIDE main(),
or in a larger program inside some function that is
executed at or sufficiently near program start.

> int main()
> {
>   return 0;
> }
>
> Another error i received is
> - "previous declaration of
> 'OPENSSL_add_all_algorithms_noconf' was here"
> - "conflicting types for 'SSL_load_error_strings' "
>
> These error message above only appeared if i cancel the
> comment tag at the #include <openssl/ssl.h> and #include
> <openssl/err.h>
>
Those files provide the correct declarations (prototypes)
which conflict with the incorrect ones you mistakenly wrote.

> Hope that anyone can help me. I am now referring 3 basic
> manuals about openssl and these 3 gives different
> initialization library. Some uses
> OpenSSL_add_all_algorithms(); and there are some uses
> SSL_library_init(). I know that by using different library,
> they offer different encryption and hash function example
> like DES or any other encryption algo. Can both of them be
> used using my openssl version? Thanks a lot.

SSL_library_init adds to an internal table, which
makes usable by name/id/EVP etc., the algorithms
(potentially) needed by SSL/TLS. This is sufficient
if your application uses OpenSSL to do SSL/TLS.

OpenSSL_add_all_algorithms does this for all
algorithms (that were included at build time).
This can be needed if you want to do other crypto
functions instead of or in addition to SSL/TLS.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: warning: data definition has no type or storage class

Vivek Subbarao
In reply to this post by omronz
OpenSSL_add_all_algorithms(); //the warning message returned here
SSL_load_error_strings();       //the warning message returned here

You are redeclaring the above functions in your program which are
already declared and implemented in openssl lib. U need to move these
functions into main() or some other function

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of omronz
Sent: 03 August 2009 10:11
To: [hidden email]
Subject: warning: data definition has no type or storage class


Hai everyone

I am new in SSL. I start to play around OpenSSL by creating a simple
server
that uses openssl. So, I just intialize the openssl main library but my
program returned the warning message "data definition  has no type or
storage class" What does this mean and how can i eliminate this warning
message? Hope that anyone here can help me since I am really new in
OpenSSL.
My OpenSSL version is 0.9.8g 19 Oct 2007.

#include <openssl/bio.h>
//#include <openssl/ssl.h>
//#include <openssl/err.h>

OpenSSL_add_all_algorithms(); //the warning message returned here
SSL_load_error_strings();       //the warning message returned here

int main()
{
  return 0;
}

Another error i received is
- "previous declaration of 'OPENSSL_add_all_algorithms_noconf' was here"
- "conflicting types for 'SSL_load_error_strings' "

These error message above only appeared if i cancel the comment tag at
the
#include <openssl/ssl.h> and #include <openssl/err.h>

Hope that anyone can help me. I am now referring 3 basic manuals about
openssl and these 3 gives different initialization library. Some uses
OpenSSL_add_all_algorithms(); and there are some uses
SSL_library_init(). I
know that by using different library, they offer different encryption
and
hash function example like DES or any other encryption algo. Can both of
them be used using my openssl version? Thanks a lot.
--
View this message in context:
http://www.nabble.com/warning%3A-data-definition-has-no-type-or-storage-
class-tp24785280p24785280.html
Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

RE: warning: data definition has no type or storage class

omronz
In reply to this post by Dave Thompson-4
hmm, so you mean that these are function call statements? or is it a function prototype? Yes, i was aware about the data type of the function prototype, but since I never tried OpenSSL before, so i just try and see the error is. Silly me  

I tried to put the statement in the main block, but then an error message displayed "undefined reference to 'OpenSSL_add_all_algorithm" and "undefined reference to 'SSL_load_error_strings'

Is there any linkage i forgot to put? Anyway, thanks for the reply.



Dave Thompson-4 wrote
> From: owner-openssl-dev@openssl.org On Behalf Of omronz
> Sent: Monday, 03 August, 2009 00:41

> I am new in SSL. I start to play around OpenSSL by creating a
> simple server that uses openssl. So, I just intialize the
> openssl main library but my program returned the warning
> message "data definition  has no type or storage class" What
> does this mean and how can i eliminate this warning message?
> Hope that anyone here can help me since I am really new in OpenSSL.
> My OpenSSL version is 0.9.8g 19 Oct 2007.
>
Apparently you are new to C programming also.

> #include <openssl/bio.h>
> //#include <openssl/ssl.h>
> //#include <openssl/err.h>
>
> OpenSSL_add_all_algorithms(); //the warning message returned here
> SSL_load_error_strings();       //the warning message returned here
>
You cannot have executable statements outside of a function
body (more precisely, block) in C, so these are treated as
VERY OLD pre-"K&R1" (circa 1975) declarations with
no return type (implicit int) hence the warnings.
These should be calls (statements) INSIDE main(),
or in a larger program inside some function that is
executed at or sufficiently near program start.

> int main()
> {
>   return 0;
> }
>
> Another error i received is
> - "previous declaration of
> 'OPENSSL_add_all_algorithms_noconf' was here"
> - "conflicting types for 'SSL_load_error_strings' "
>
> These error message above only appeared if i cancel the
> comment tag at the #include <openssl/ssl.h> and #include
> <openssl/err.h>
>
Those files provide the correct declarations (prototypes)
which conflict with the incorrect ones you mistakenly wrote.

> Hope that anyone can help me. I am now referring 3 basic
> manuals about openssl and these 3 gives different
> initialization library. Some uses
> OpenSSL_add_all_algorithms(); and there are some uses
> SSL_library_init(). I know that by using different library,
> they offer different encryption and hash function example
> like DES or any other encryption algo. Can both of them be
> used using my openssl version? Thanks a lot.

SSL_library_init adds to an internal table, which
makes usable by name/id/EVP etc., the algorithms
(potentially) needed by SSL/TLS. This is sufficient
if your application uses OpenSSL to do SSL/TLS.

OpenSSL_add_all_algorithms does this for all
algorithms (that were included at build time).
This can be needed if you want to do other crypto
functions instead of or in addition to SSL/TLS.



______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majordomo@openssl.org
Reply | Threaded
Open this post in threaded view
|

RE: warning: data definition has no type or storage class

omronz
In reply to this post by Vivek Subbarao
hmm, so you mean that these are function call statements? or is it a function prototype? Yes, i was aware about the data type of the function prototype, but since I never tried OpenSSL before, so i just try and see the error is. Silly me  

I tried to put the statement in the main block, but then an error message displayed "undefined reference to 'OpenSSL_add_all_algorithm" and "undefined reference to 'SSL_load_error_strings'

Is there any linkage i forgot to put? Anyway, thanks for the reply.


Vivek Subbarao wrote
OpenSSL_add_all_algorithms(); //the warning message returned here
SSL_load_error_strings();       //the warning message returned here

You are redeclaring the above functions in your program which are
already declared and implemented in openssl lib. U need to move these
functions into main() or some other function

-----Original Message-----
From: owner-openssl-dev@openssl.org
[mailto:owner-openssl-dev@openssl.org] On Behalf Of omronz
Sent: 03 August 2009 10:11
To: openssl-dev@openssl.org
Subject: warning: data definition has no type or storage class


Hai everyone

I am new in SSL. I start to play around OpenSSL by creating a simple
server
that uses openssl. So, I just intialize the openssl main library but my
program returned the warning message "data definition  has no type or
storage class" What does this mean and how can i eliminate this warning
message? Hope that anyone here can help me since I am really new in
OpenSSL.
My OpenSSL version is 0.9.8g 19 Oct 2007.

#include <openssl/bio.h>
//#include <openssl/ssl.h>
//#include <openssl/err.h>

OpenSSL_add_all_algorithms(); //the warning message returned here
SSL_load_error_strings();       //the warning message returned here

int main()
{
  return 0;
}

Another error i received is
- "previous declaration of 'OPENSSL_add_all_algorithms_noconf' was here"
- "conflicting types for 'SSL_load_error_strings' "

These error message above only appeared if i cancel the comment tag at
the
#include <openssl/ssl.h> and #include <openssl/err.h>

Hope that anyone can help me. I am now referring 3 basic manuals about
openssl and these 3 gives different initialization library. Some uses
OpenSSL_add_all_algorithms(); and there are some uses
SSL_library_init(). I
know that by using different library, they offer different encryption
and
hash function example like DES or any other encryption algo. Can both of
them be used using my openssl version? Thanks a lot.
--
View this message in context:
http://www.nabble.com/warning%3A-data-definition-has-no-type-or-storage-
class-tp24785280p24785280.html
Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majordomo@openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majordomo@openssl.org
Reply | Threaded
Open this post in threaded view
|

RE: warning: data definition has no type or storage class

Vivek Subbarao
Uncomment the #include statements. That should solve your problems.

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of omronz
Sent: 04 August 2009 14:17
To: [hidden email]
Subject: RE: warning: data definition has no type or storage class


hmm, so you mean that these are function call statements? or is it a
function
prototype? Yes, i was aware about the data type of the function
prototype,
but since I never tried OpenSSL before, so i just try and see the error
is.
Silly me  :-)

I tried to put the statement in the main block, but then an error
message
displayed "undefined reference to 'OpenSSL_add_all_algorithm" and
"undefined
reference to 'SSL_load_error_strings'

Is there any linkage i forgot to put? Anyway, thanks for the reply.



Vivek Subbarao wrote:

>
> OpenSSL_add_all_algorithms(); //the warning message returned here
> SSL_load_error_strings();       //the warning message returned here
>
> You are redeclaring the above functions in your program which are
> already declared and implemented in openssl lib. U need to move these
> functions into main() or some other function
>
> -----Original Message-----
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of omronz
> Sent: 03 August 2009 10:11
> To: [hidden email]
> Subject: warning: data definition has no type or storage class
>
>
> Hai everyone
>
> I am new in SSL. I start to play around OpenSSL by creating a simple
> server
> that uses openssl. So, I just intialize the openssl main library but
my
> program returned the warning message "data definition  has no type or
> storage class" What does this mean and how can i eliminate this
warning

> message? Hope that anyone here can help me since I am really new in
> OpenSSL.
> My OpenSSL version is 0.9.8g 19 Oct 2007.
>
> #include <openssl/bio.h>
> //#include <openssl/ssl.h>
> //#include <openssl/err.h>
>
> OpenSSL_add_all_algorithms(); //the warning message returned here
> SSL_load_error_strings();       //the warning message returned here
>
> int main()
> {
>   return 0;
> }
>
> Another error i received is
> - "previous declaration of 'OPENSSL_add_all_algorithms_noconf' was
here"

> - "conflicting types for 'SSL_load_error_strings' "
>
> These error message above only appeared if i cancel the comment tag at
> the
> #include <openssl/ssl.h> and #include <openssl/err.h>
>
> Hope that anyone can help me. I am now referring 3 basic manuals about
> openssl and these 3 gives different initialization library. Some uses
> OpenSSL_add_all_algorithms(); and there are some uses
> SSL_library_init(). I
> know that by using different library, they offer different encryption
> and
> hash function example like DES or any other encryption algo. Can both
of
> them be used using my openssl version? Thanks a lot.
> --
> View this message in context:
>
http://www.nabble.com/warning%3A-data-definition-has-no-type-or-storage-

> class-tp24785280p24785280.html
> Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> Development Mailing List                       [hidden email]
> Automated List Manager                           [hidden email]
>
>

--
View this message in context:
http://www.nabble.com/warning%3A-data-definition-has-no-type-or-storage-
class-tp24785280p24804525.html
Sent from the OpenSSL - Dev mailing list archive at Nabble.com.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: warning: data definition has no type or storage class

Goetz Babin-Ebell
In reply to this post by omronz
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

omronz wrote:
| hmm, so you mean that these are function call statements? or is it a
function
| prototype? Yes, i was aware about the data type of the function prototype,
| but since I never tried OpenSSL before, so i just try and see the
error is.
| Silly me  :-)
|
| I tried to put the statement in the main block, but then an error message
| displayed "undefined reference to 'OpenSSL_add_all_algorithm" and
"undefined
| reference to 'SSL_load_error_strings'
|
| Is there any linkage i forgot to put? Anyway, thanks for the reply.

OpenSSL_add_all_algorithms() needs libcrypto,
SSL_load_error_strings() needs libssl, which needs libcrypto.

So at least with gcc the link line should contain -lssl -lcrypto

And please, this thread belongs into openssl-users...

Goetz

- --
DMCA: The greed of the few outweighs the freedom of the many
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKeFVZ2iGqZUF3qPYRAmjoAJ9FCs+fiKMEAsQ3UgK5KHxOiNaJCQCdGF4B
owqzzG/2ePO9aegThFYaC+U=
=18Ok
-----END PGP SIGNATURE-----
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [hidden email]
Automated List Manager                           [hidden email]