grahamst
Starting Member
- Total Posts : 33
- Reward points : 0
- Joined: 2010/11/05 04:13:55
- Location: 0
- Status: offline
Hi,
I have a project which was building and running just fine — but needed some changes.
I re-arranged some config code into its own config.c file, and all hell broke loose.
Can someone please explain to me what the following message actually means ???.
error: storage class specified for parameter ‘PORTNUM’
The error occurs in this simple bit of code :
#include <GenericTypeDefs.h>
#include «HardwareProfile.h»
#include «Tick.h»
typedef enum _PORTNUM
{
PORT1 = 0,
PORT2 = 1,
PORTSRV = 99
} PORTNUM;
All the following references then do not recognise ‘PORTNUM’
Using XC32 V1.30 in MPLABX V 2.05
This is doing my head in now :-(( — the error report is worse than useless — as its meaningless :-O.
Thanks ever hopefully…..
Graham
DarioG
Allmächtig.
- Total Posts : 54081
- Reward points : 0
- Joined: 2006/02/25 08:58:22
- Location: Oesterreich
- Status: offline
Re: error: storage class specified for parameter
2014/04/29 02:21:53
(permalink)
Are you sure that the error happens (only) because of the code above?
grahamst
Starting Member
- Total Posts : 33
- Reward points : 0
- Joined: 2010/11/05 04:13:55
- Location: 0
- Status: offline
Re: error: storage class specified for parameter
2014/04/29 02:56:13
(permalink)
Dario,
Thanks for the reply — but no I am not sure :-O.
Its part of a much larger project (using the MLA TCP/IP stack :-O), so something strange is obviously happening elsewhere, but as the error report is so meaningless I cannot figure out where…..
I have tried moving the code — and another enum into a new file ‘MyEnums.h’. Then including this in my original file.
I can only assume that there is an error somewhere else in my code, which is being masked by and causing this — but how to find the other error with this one reported :-O.
Now the same error is reported for BOTH enums.
/*
* File: MyEnums.h
* Author: Graham
*
* Created on 29 April 2014, 10:06
*/
#ifndef __MYENUMS_H
#define __MYENUMS_H
//#include <GenericTypeDefs.h>
typedef enum
{
PORT1 = 0,
PORT2 = 1,
PORTSRV = 99
} PORTNUM;
typedef enum _MSG_TYPE
{
BASE_CONTROL = 1,
REM_CONTROL,
BASE_DATA,
REM_DATA
} MSG_TYPE;
#endif /* __MYENUMS_H */
Is there something I should be including to get the typedef enum to work ???.
The XC32 UG is also pretty useless in this area :-O.
Oh — and its exactly the same in V1.31 XC32 compiler — I even tried that :-O.
Graham
grahamst
Starting Member
- Total Posts : 33
- Reward points : 0
- Joined: 2010/11/05 04:13:55
- Location: 0
- Status: offline
Re: error: storage class specified for parameter
2014/04/29 03:00:25
(permalink)
Oh my G*D !!!!
All this caused by a missing ; in my ‘MyConfig.h’ file :-((.
Add the ; and this problem goes away :-O.
Really helpful — thanks MicroChip ;-)).
Regards
Graham
DarioG
Allmächtig.
- Total Posts : 54081
- Reward points : 0
- Joined: 2006/02/25 08:58:22
- Location: Oesterreich
- Status: offline
Re: error: storage class specified for parameter
2014/04/29 03:36:57
(permalink)
LOL ok
Ehm, that’s the way C compilers go: an error can … propagate through the code and it may be really hard to spot the origin of it!
I used gcc version 4.2.1
on Target: sparc-sun-solaris2.8
Configured with: /net/Src/Gnu/GCC/gcc-4.2.1/configure prefix=/usr/local/Gnu/Sol8 enable-languages=c,c++,fortran with-ld=/usr/local/Gnu/bin/ld with-gnu-ld with-as=/usr/local/Gnu/bin/as with-gnu-as with-ar=/usr/local/Gnu/bin/ar with-gnu-ar
Thread model: posix
to make a program which include some of standard system header file
Making the code gave this error message:
gcc -o resource_vector_test.o -c resource_vector_test.c
In file included from /usr/include/sys/select.h:51,
from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/sys/types.h:574,
from /usr/include/fcntl.h:39,
from resource_vector_test.c:2:
/usr/include/sys/time.h:345: error: redefinition of parameter ‘_RESTRICT_KYWD’
/usr/include/sys/time.h:344: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/time.h:395: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/sys/time.h:395: error: previous definition of ‘_RESTRICT_KYWD’ was here
In file included from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/time.h:29,
from /usr/include/sys/time.h:416,
from /usr/include/sys/select.h:51,
from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/sys/types.h:574,
from /usr/include/fcntl.h:39,
from resource_vector_test.c:2:
/usr/include/iso/time_iso.h:110: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/time_iso.h:110: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/time_iso.h:111: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/time_iso.h:110: error: previous definition of ‘_RESTRICT_KYWD’ was here
In file included from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/sys/types.h:574,
from /usr/include/fcntl.h:39,
from resource_vector_test.c:2:
/usr/include/sys/select.h:168: error: redefinition of parameter ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:168: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/select.h:169: error: redefinition of parameter ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:168: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/select.h:169: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:169: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/select.h:172: error: redefinition of parameter ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:172: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/select.h:173: error: redefinition of parameter ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:172: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/select.h:173: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:173: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/sys/select.h:174: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/sys/select.h:173: error: previous definition of ‘_RESTRICT_KYWD’ was here
In file included from resource_vector_test.c:3:
/usr/include/unistd.h: In function ‘_exit’:
/usr/include/unistd.h:292: error: expected declaration specifiers before ‘__NORETURN’
/usr/include/unistd.h:299: error: storage class specified for parameter ‘fattach’
/usr/include/unistd.h:302: error: storage class specified for parameter ‘fchdir’
/usr/include/unistd.h:303: error: storage class specified for parameter ‘fchown’
/usr/include/unistd.h:306: error: storage class specified for parameter ‘fchownat’
/usr/include/unistd.h:310: error: storage class specified for parameter ‘fchroot’
/usr/include/unistd.h:314: error: storage class specified for parameter ‘fdatasync’
/usr/include/unistd.h:322: error: storage class specified for parameter ‘fdetach’
/usr/include/unistd.h:324: error: storage class specified for parameter ‘fork’
/usr/include/unistd.h:326: error: storage class specified for parameter ‘fork1’
/usr/include/unistd.h:327: error: storage class specified for parameter ‘forkall’
/usr/include/unistd.h:329: error: storage class specified for parameter ‘fpathconf’
/usr/include/unistd.h:332: error: storage class specified for parameter ‘fsync’
/usr/include/unistd.h:337: error: storage class specified for parameter ‘ftruncate’
/usr/include/unistd.h:339: error: storage class specified for parameter ‘getcwd’
/usr/include/unistd.h:342: error: storage class specified for parameter ‘getdtablesize’
/usr/include/unistd.h:344: error: storage class specified for parameter ‘getegid’
/usr/include/unistd.h:345: error: storage class specified for parameter ‘geteuid’
/usr/include/unistd.h:346: error: storage class specified for parameter ‘getgid’
/usr/include/unistd.h:347: error: storage class specified for parameter ‘getgroups’
/usr/include/unistd.h:349: error: storage class specified for parameter ‘gethostid’
/usr/include/unistd.h:354: error: storage class specified for parameter ‘gethostname’
/usr/include/unistd.h:356: error: storage class specified for parameter ‘getlogin’
/usr/include/unistd.h:369: error: storage class specified for parameter ‘getpagesize’
/usr/include/unistd.h:371: error: storage class specified for parameter ‘getpgid’
/usr/include/unistd.h:373: error: storage class specified for parameter ‘getpid’
/usr/include/unistd.h:374: error: storage class specified for parameter ‘getppid’
/usr/include/unistd.h:375: error: storage class specified for parameter ‘getpgrp’
/usr/include/unistd.h:381: error: storage class specified for parameter ‘getsid’
/usr/include/unistd.h:383: error: storage class specified for parameter ‘getuid’
/usr/include/unistd.h:385: error: storage class specified for parameter ‘getusershell’
/usr/include/unistd.h:388: error: storage class specified for parameter ‘getwd’
/usr/include/unistd.h:396: error: storage class specified for parameter ‘ioctl’
/usr/include/unistd.h:397: error: storage class specified for parameter ‘isaexec’
/usr/include/unistd.h:398: error: storage class specified for parameter ‘issetugid’
/usr/include/unistd.h:400: error: storage class specified for parameter ‘isatty’
/usr/include/unistd.h:402: error: storage class specified for parameter ‘lchown’
/usr/include/unistd.h:404: error: storage class specified for parameter ‘link’
/usr/include/unistd.h:406: error: storage class specified for parameter ‘llseek’
/usr/include/unistd.h:411: error: storage class specified for parameter ‘lockf’
/usr/include/unistd.h:413: error: storage class specified for parameter ‘lseek’
/usr/include/unistd.h:416: error: storage class specified for parameter ‘nice’
/usr/include/unistd.h:419: error: storage class specified for parameter ‘mincore’
/usr/include/unistd.h:421: error: storage class specified for parameter ‘pathconf’
/usr/include/unistd.h:422: error: storage class specified for parameter ‘pause’
/usr/include/unistd.h:423: error: storage class specified for parameter ‘pipe’
/usr/include/unistd.h:427: error: storage class specified for parameter ‘pread’
/usr/include/unistd.h:430: error: storage class specified for parameter ‘profil’
/usr/include/unistd.h:442: error: storage class specified for parameter ‘pthread_atfork’
/usr/include/unistd.h:446: error: storage class specified for parameter ‘ptrace’
/usr/include/unistd.h:451: error: storage class specified for parameter ‘pwrite’
/usr/include/unistd.h:456: error: storage class specified for parameter ‘rcmd_af’
/usr/include/unistd.h:458: error: storage class specified for parameter ‘read’
/usr/include/unistd.h:461: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/unistd.h:461: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/unistd.h:462: error: storage class specified for parameter ‘readlink’
/usr/include/unistd.h:466: error: storage class specified for parameter ‘rename’
/usr/include/unistd.h:470: error: storage class specified for parameter ‘renameat’
/usr/include/unistd.h:473: error: storage class specified for parameter ‘resolvepath’
/usr/include/unistd.h:476: error: storage class specified for parameter ‘rexec_af’
/usr/include/unistd.h:478: error: storage class specified for parameter ‘rmdir’
/usr/include/unistd.h:481: error: storage class specified for parameter ‘rresvport_af’
/usr/include/unistd.h:486: error: storage class specified for parameter ‘sbrk’
/usr/include/unistd.h:489: error: storage class specified for parameter ‘setegid’
/usr/include/unistd.h:490: error: storage class specified for parameter ‘seteuid’
/usr/include/unistd.h:492: error: storage class specified for parameter ‘setgid’
/usr/include/unistd.h:494: error: storage class specified for parameter ‘setgroups’
/usr/include/unistd.h:495: error: storage class specified for parameter ‘sethostname’
/usr/include/unistd.h:497: error: storage class specified for parameter ‘setpgid’
/usr/include/unistd.h:499: error: storage class specified for parameter ‘setpgrp’
/usr/include/unistd.h:500: error: storage class specified for parameter ‘setregid’
/usr/include/unistd.h:501: error: storage class specified for parameter ‘setreuid’
/usr/include/unistd.h:503: error: storage class specified for parameter ‘setsid’
/usr/include/unistd.h:504: error: storage class specified for parameter ‘setuid’
/usr/include/unistd.h:506: error: storage class specified for parameter ‘setusershell’
/usr/include/unistd.h:508: error: storage class specified for parameter ‘sleep’
/usr/include/unistd.h:510: error: storage class specified for parameter ‘stime’
/usr/include/unistd.h:517: error: storage class specified for parameter ‘symlink’
/usr/include/unistd.h:518: error: storage class specified for parameter ‘sync’
/usr/include/unistd.h:527: error: storage class specified for parameter ‘sysconf’
/usr/include/unistd.h:528: error: storage class specified for parameter ‘tcgetpgrp’
/usr/include/unistd.h:529: error: storage class specified for parameter ‘tcsetpgrp’
/usr/include/unistd.h:533: error: storage class specified for parameter ‘tell’
/usr/include/unistd.h:538: error: storage class specified for parameter ‘truncate’
/usr/include/unistd.h:540: error: storage class specified for parameter ‘ttyname’
/usr/include/unistd.h:542: error: storage class specified for parameter ‘ualarm’
/usr/include/unistd.h:544: error: storage class specified for parameter ‘unlink’
/usr/include/unistd.h:547: error: storage class specified for parameter ‘unlinkat’
/usr/include/unistd.h:550: error: storage class specified for parameter ‘usleep’
/usr/include/unistd.h:553: error: storage class specified for parameter ‘vfork’
/usr/include/unistd.h:556: error: storage class specified for parameter ‘vhangup’
/usr/include/unistd.h:558: error: storage class specified for parameter ‘write’
/usr/include/unistd.h:560: error: storage class specified for parameter ‘yield’
/usr/include/unistd.h:566: error: storage class specified for parameter ‘ftruncate64’
/usr/include/unistd.h:567: error: storage class specified for parameter ‘lseek64’
/usr/include/unistd.h:568: error: storage class specified for parameter ‘pread64’
/usr/include/unistd.h:569: error: storage class specified for parameter ‘pwrite64’
/usr/include/unistd.h:570: error: storage class specified for parameter ‘tell64’
/usr/include/unistd.h:571: error: storage class specified for parameter ‘truncate64’
/usr/include/unistd.h:572: error: storage class specified for parameter ‘lockf64’
/usr/include/unistd.h:962: error: storage class specified for parameter ‘getlogin_r’
/usr/include/unistd.h:963: error: storage class specified for parameter ‘ttyname_r’
In file included from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:27,
from resource_vector_test.c:4:
/usr/include/iso/string_iso.h:77: error: storage class specified for parameter ‘memcmp’
/usr/include/iso/string_iso.h:78: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:78: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:78: error: storage class specified for parameter ‘memcpy’
/usr/include/iso/string_iso.h:79: error: storage class specified for parameter ‘memmove’
/usr/include/iso/string_iso.h:80: error: storage class specified for parameter ‘memset’
/usr/include/iso/string_iso.h:81: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:81: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:81: error: storage class specified for parameter ‘strcat’
/usr/include/iso/string_iso.h:82: error: storage class specified for parameter ‘strcmp’
/usr/include/iso/string_iso.h:83: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:83: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:83: error: storage class specified for parameter ‘strcpy’
/usr/include/iso/string_iso.h:84: error: storage class specified for parameter ‘strcoll’
/usr/include/iso/string_iso.h:85: error: storage class specified for parameter ‘strcspn’
/usr/include/iso/string_iso.h:86: error: storage class specified for parameter ‘strerror’
/usr/include/iso/string_iso.h:87: error: storage class specified for parameter ‘strlen’
/usr/include/iso/string_iso.h:88: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:88: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:88: error: storage class specified for parameter ‘strncat’
/usr/include/iso/string_iso.h:89: error: storage class specified for parameter ‘strncmp’
/usr/include/iso/string_iso.h:90: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:90: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:90: error: storage class specified for parameter ‘strncpy’
/usr/include/iso/string_iso.h:91: error: storage class specified for parameter ‘strspn’
/usr/include/iso/string_iso.h:92: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:92: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:92: error: storage class specified for parameter ‘strtok’
/usr/include/iso/string_iso.h:93: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/string_iso.h:93: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/string_iso.h:93: error: storage class specified for parameter ‘strxfrm’
/usr/include/iso/string_iso.h:147: error: storage class specified for parameter ‘memchr’
/usr/include/iso/string_iso.h:148: error: storage class specified for parameter ‘strchr’
/usr/include/iso/string_iso.h:149: error: storage class specified for parameter ‘strpbrk’
/usr/include/iso/string_iso.h:150: error: storage class specified for parameter ‘strrchr’
/usr/include/iso/string_iso.h:151: error: storage class specified for parameter ‘strstr’
In file included from resource_vector_test.c:4:
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:72: error: storage class specified for parameter ‘memccpy’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:77: error: storage class specified for parameter ‘strsignal’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:78: error: storage class specified for parameter ‘ffs’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:79: error: storage class specified for parameter ‘strcasecmp’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:80: error: storage class specified for parameter ‘strncasecmp’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:81: error: storage class specified for parameter ‘strlcpy’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:82: error: storage class specified for parameter ‘strlcat’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/string.h:88: error: storage class specified for parameter ‘strdup’
In file included from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:27,
from resource_vector_test.c:5:
/usr/include/iso/stdlib_iso.h:55: error: storage class specified for parameter ‘__ctype’
/usr/include/iso/stdlib_iso.h:69: error: storage class specified for parameter ‘div_t’
/usr/include/iso/stdlib_iso.h:74: error: storage class specified for parameter ‘ldiv_t’
/usr/include/iso/stdlib_iso.h:116: error: storage class specified for parameter ‘wchar_t’
/usr/include/iso/stdlib_iso.h:123: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__NORETURN’
/usr/include/iso/stdlib_iso.h:124: error: storage class specified for parameter ‘abs’
/usr/include/iso/stdlib_iso.h:125: error: storage class specified for parameter ‘atexit’
/usr/include/iso/stdlib_iso.h:126: error: storage class specified for parameter ‘atof’
/usr/include/iso/stdlib_iso.h:127: error: storage class specified for parameter ‘atoi’
/usr/include/iso/stdlib_iso.h:128: error: storage class specified for parameter ‘atol’
/usr/include/iso/stdlib_iso.h:130: error: storage class specified for parameter ‘bsearch’
/usr/include/iso/stdlib_iso.h:137: error: storage class specified for parameter ‘calloc’
/usr/include/iso/stdlib_iso.h:138: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘div’
/usr/include/iso/stdlib_iso.h:140: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘__NORETURN’
/usr/include/iso/stdlib_iso.h:141: error: storage class specified for parameter ‘free’
/usr/include/iso/stdlib_iso.h:142: error: storage class specified for parameter ‘getenv’
/usr/include/iso/stdlib_iso.h:143: error: storage class specified for parameter ‘labs’
/usr/include/iso/stdlib_iso.h:144: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘ldiv’
/usr/include/iso/stdlib_iso.h:145: error: storage class specified for parameter ‘malloc’
/usr/include/iso/stdlib_iso.h:146: error: storage class specified for parameter ‘mblen’
/usr/include/iso/stdlib_iso.h:147: error: expected ‘)’ before ‘*’ token
/usr/include/iso/stdlib_iso.h:149: error: expected ‘)’ before ‘*’ token
/usr/include/iso/stdlib_iso.h:150: error: storage class specified for parameter ‘qsort’
/usr/include/iso/stdlib_iso.h:156: error: storage class specified for parameter ‘rand’
/usr/include/iso/stdlib_iso.h:157: error: storage class specified for parameter ‘realloc’
/usr/include/iso/stdlib_iso.h:158: error: storage class specified for parameter ‘srand’
/usr/include/iso/stdlib_iso.h:159: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/stdlib_iso.h:159: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/stdlib_iso.h:159: error: storage class specified for parameter ‘strtod’
/usr/include/iso/stdlib_iso.h:160: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/stdlib_iso.h:160: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/stdlib_iso.h:160: error: storage class specified for parameter ‘strtol’
/usr/include/iso/stdlib_iso.h:162: error: conflicting types for ‘_RESTRICT_KYWD’
/usr/include/iso/stdlib_iso.h:161: error: previous definition of ‘_RESTRICT_KYWD’ was here
/usr/include/iso/stdlib_iso.h:162: error: storage class specified for parameter ‘strtoul’
/usr/include/iso/stdlib_iso.h:163: error: storage class specified for parameter ‘system’
/usr/include/iso/stdlib_iso.h:164: error: expected declaration specifiers or ‘…’ before ‘wchar_t’
/usr/include/iso/stdlib_iso.h:164: error: storage class specified for parameter ‘wctomb’
/usr/include/iso/stdlib_iso.h:165: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
In file included from resource_vector_test.c:5:
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:80: error: storage class specified for parameter ‘lldiv_t’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:121: error: storage class specified for parameter ‘_exithandle’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:126: error: storage class specified for parameter ‘drand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:127: error: storage class specified for parameter ‘erand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:128: error: storage class specified for parameter ‘jrand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:129: error: storage class specified for parameter ‘lcong48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:130: error: storage class specified for parameter ‘lrand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:131: error: storage class specified for parameter ‘mrand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:132: error: storage class specified for parameter ‘nrand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:133: error: storage class specified for parameter ‘seed48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:134: error: storage class specified for parameter ‘srand48’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:135: error: storage class specified for parameter ‘putenv’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:136: error: storage class specified for parameter ‘setkey’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:153: error: storage class specified for parameter ‘swab’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:159: error: storage class specified for parameter ‘mkstemp’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:164: error: storage class specified for parameter ‘mkstemp64’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:170: error: storage class specified for parameter ‘a64l’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:171: error: storage class specified for parameter ‘ecvt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:172: error: storage class specified for parameter ‘fcvt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:173: error: storage class specified for parameter ‘gcvt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:174: error: storage class specified for parameter ‘getsubopt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:175: error: storage class specified for parameter ‘grantpt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:176: error: storage class specified for parameter ‘initstate’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:177: error: storage class specified for parameter ‘l64a’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:178: error: storage class specified for parameter ‘mktemp’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:179: error: storage class specified for parameter ‘ptsname’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:180: error: storage class specified for parameter ‘random’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:181: error: storage class specified for parameter ‘realpath’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:182: error: storage class specified for parameter ‘setstate’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:183: error: storage class specified for parameter ‘srandom’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:184: error: storage class specified for parameter ‘ttyslot’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:185: error: storage class specified for parameter ‘unlockpt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:186: error: storage class specified for parameter ‘valloc’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:191: error: storage class specified for parameter ‘dup2’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:192: error: storage class specified for parameter ‘qecvt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:193: error: storage class specified for parameter ‘qfcvt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:194: error: storage class specified for parameter ‘qgcvt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:195: error: storage class specified for parameter ‘getcwd’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:195: error: redefinition of parameter ‘getcwd’
/usr/include/unistd.h:339: error: previous definition of ‘getcwd’ was here
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:196: error: storage class specified for parameter ‘getexecname’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:197: error: storage class specified for parameter ‘getlogin’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:197: error: redefinition of parameter ‘getlogin’
/usr/include/unistd.h:356: error: previous definition of ‘getlogin’ was here
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:198: error: storage class specified for parameter ‘getopt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:199: error: storage class specified for parameter ‘optarg’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:200: error: storage class specified for parameter ‘optind’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:200: error: storage class specified for parameter ‘opterr’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:200: error: storage class specified for parameter ‘optopt’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:201: error: storage class specified for parameter ‘getpass’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:202: error: storage class specified for parameter ‘getpassphrase’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:203: error: storage class specified for parameter ‘getpw’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:204: error: storage class specified for parameter ‘isatty’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:204: error: redefinition of parameter ‘isatty’
/usr/include/unistd.h:400: error: previous definition of ‘isatty’ was here
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:205: error: storage class specified for parameter ‘memalign’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:206: error: storage class specified for parameter ‘ttyname’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:206: error: redefinition of parameter ‘ttyname’
/usr/include/unistd.h:540: error: previous definition of ‘ttyname’ was here
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:209: error: storage class specified for parameter ‘atoll’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:210: error: storage class specified for parameter ‘llabs’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘lldiv’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:212: error: storage class specified for parameter ‘lltostr’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:213: error: storage class specified for parameter ‘strtoll’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:214: error: storage class specified for parameter ‘strtoull’
/usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/stdlib.h:215: error: storage class specified for parameter ‘ulltostr’
In file included from resource_vector_test.c:7:
/usr/include/sys/mman.h:162: error: storage class specified for parameter ‘mmap’
/usr/include/sys/mman.h:163: error: storage class specified for parameter ‘munmap’
/usr/include/sys/mman.h:164: error: storage class specified for parameter ‘mprotect’
/usr/include/sys/mman.h:165: error: storage class specified for parameter ‘msync’
/usr/include/sys/mman.h:166: error: storage class specified for parameter ‘mlock’
/usr/include/sys/mman.h:167: error: storage class specified for parameter ‘munlock’
/usr/include/sys/mman.h:168: error: storage class specified for parameter ‘mincore’
/usr/include/sys/mman.h:168: error: redefinition of parameter ‘mincore’
/usr/include/unistd.h:419: error: previous definition of ‘mincore’ was here
/usr/include/sys/mman.h:169: error: storage class specified for parameter ‘memcntl’
/usr/include/sys/mman.h:170: error: storage class specified for parameter ‘madvise’
/usr/include/sys/mman.h:172: error: storage class specified for parameter ‘getpagesizes’
/usr/include/sys/mman.h:181: error: storage class specified for parameter ‘mmap64’
/usr/include/sys/mman.h:186: error: storage class specified for parameter ‘mlockall’
/usr/include/sys/mman.h:187: error: storage class specified for parameter ‘munlockall’
/usr/include/sys/mman.h:188: error: storage class specified for parameter ‘shm_open’
/usr/include/sys/mman.h:189: error: storage class specified for parameter ‘shm_unlink’
In file included from /usr/local/Gnu/Sol8/lib/gcc/sparc-sun-solaris2.8/4.2.1/include/sys/signal.h:28,
from /usr/include/sys/procset.h:42,
from /usr/include/sys/processor.h:39,
from resource_vector_test.c:9:
/usr/include/sys/iso/signal_iso.h:101: error: storage class specified for parameter ‘_sysconf’
In file included from /usr/local/Gnu/Sol8/lib/gcc/sparc
ошибка: класс хранения указан для параметра
У меня написан код C. Когда я компилирую его в Linux, в заголовочном файле появляется следующая ошибка: storage class specified for parameter i32 , i8
и так далее
typedef int i32;
typedef char i8;
Скорее всего, вы где-то забыли точку с запятой в файле заголовка. Убедитесь, что каждая строка заканчивается на ;
Создан 22 июля ’15, 13:07
У вас где-то есть код, который, вероятно, указан в полном тексте сообщения об ошибке, который делает что-то вроде этого:
void function(static int foo)
Компания static
не допускается. Это также может быть другой класс хранилища, например register
or extern
.
Создан 18 июля ’14, 14:07
У меня был такой же опыт. Проблема заключалась в объявлении прототипа функции в файле заголовка, где в конце объявления функции отсутствовала точка с запятой.
Функция была указана в журналах компиляции как «В функции …» непосредственно перед фрагментом ошибки.
Надеюсь это поможет!!
Создан 07 сен.
Однажды я совершил ту же ошибку. Решение заключалось в том, чтобы просматривать файлы и искать ожидающие утверждения операторы (например, незакрытые круглые скобки или отсутствующую точку с запятой). Обычно это действительно тривиальная ошибка, но компилятор жалуется.
Плохая новость в том, что он не всегда жалуется в нужной строке (или даже в нужном файле!). Хорошая новость в том, что в этих случаях он говорит что-то полезное, например:
WRONGFILE.h: In function ‘FUNCTION_OF_ANOTHER_FILE_WRT_WRONG_FILE’"
WRONGFILE:line:col: error: storage class specified for parameter ‘param’ before.
Идите и проверьте тот другой файл, о котором сообщили.
Создан 30 сен.
Чтобы добавить ;
: другой случай может отсутствовать )
в объявлении указателя функции:
extern void init_callbacks(void (*init)(), void (*end());
(отсутствует закрывающая скобка после *end
).
ответ дан 09 мар ’17, в 16:03
Если вы используете редактор vim, вы можете легко найти недостающую точку с запятой, набрав:
/[^;]s*$
… а затем прыгать вверх / вниз (с N / n), пока не будет найдена проблемная строка.
Создан 17 янв.
У меня была аналогичная проблема, в то время как в статическом назначении отсутствовало имя класса хранилища. Например:
.h:
class MyClass {
static const int something;
}
.cpp:
const int something = 1; // returns error
const int MyClass::something = 1; // OK
ответ дан 29 мая ’18, 09:05
Не тот ответ, который вы ищете? Просмотрите другие вопросы с метками
c
linux
or задайте свой вопрос.
-
03-16-2008
#1
Registered User
error: storage class specified for parameter
Hi, I am having this compiling error:
queue_linked.h:18: error: storage class specified for parameter �QueueEntry�
queue_linked.h:21: error: expected specifier-qualifier-list before �QueueEntry�
queue_linked.h:23: error: storage class specified for parameter �QueueNode�
queue_linked.h:26: error: expected specifier-qualifier-list before �QueueNode�
queue_linked.h:29: error: storage class specified for parameter �Queue�
queue_linked.h:31: error: expected �)� before �*� tokenCode:
//prevents multiple inclusions of header file #ifndef QUEUE_L_H #define QUEUE_L_H #include <stdio.h> #include <stdlib.h> #include "common.h" #define MAXCHAR 35 #define KEYSIZE 3 typedef struct queueentry{ char key[KEYSIZE + 1]; }QueueEntry; typedef struct queuenode { QueueEntry info; struct queuenode *next; } QueueNode; typedef struct queue { QueueNode *front; QueueNode *rear; int size; } Queue; void CreateQueue(Queue *q); Boolean QueueEmtpy(Queue *); Boolean QueueFull(Queue *); void Append(QueueEntry, Queue *); void Serve(QueueEntry *, Queue *); void AppendNode(QueueNode *, Queue *); void ServeNode(QueueNode *, Queue *); int QueueSize(Queue *); void ClearQueue(Queue *); void QueueFront(QueueEntry *, Queue *q); void TraverseQueue(Queue *, void(*)(QueueEntry)); #endif
Any help as always will be greatly appreciated
-
03-16-2008
#2
and the Hat of Guessing
I’m not sure which lines the line numbers point to, but: is there something hanging off the end of common.h?
-
03-16-2008
#3
Registered User
Originally Posted by tabstop
I’m not sure which lines the line numbers point to, but: is there something hanging off the end of common.h?
The lines that the line numbers are pointing to are in red.
I don’t understand what do you mean by hanging off the end of common.h?
common.h is inside the quotation marks.Code:
//prevents multiple inclusions of header file #ifndef QUEUE_L_H #define QUEUE_L_H #include <stdio.h> #include <stdlib.h> #include "common.h" #define MAXCHAR 35 #define KEYSIZE 3 typedef struct queueentry char key[KEYSIZE + 1]; }QueueEntry; typedef struct queuenode { QueueEntry info; struct queuenode *next; } QueueNode; typedef struct queue { QueueNode *front; QueueNode *rear; int size; } Queue; void CreateQueue(Queue *q); Boolean QueueEmtpy(Queue *); Boolean QueueFull(Queue *); void Append(QueueEntry, Queue *); void Serve(QueueEntry *, Queue *); void AppendNode(QueueNode *, Queue *); void ServeNode(QueueNode *, Queue *); int QueueSize(Queue *); void ClearQueue(Queue *); void QueueFront(QueueEntry *, Queue *q); void TraverseQueue(Queue *, void(*)(QueueEntry)); #endif
-
03-16-2008
#4
and the Hat of Guessing
I mean that maybe common.h ends, somehow, with the word «extern» or something, due to a bad cut’n’paste. Then, since the contents of common.h are just slopped at the top of this file, that extern would then be modifying typedef struct queueentry, and that would contribute to this chain of errors that you see.
-
03-16-2008
#5
Registered User
Originally Posted by tabstop
I mean that maybe common.h ends, somehow, with the word «extern» or something, due to a bad cut’n’paste. Then, since the contents of common.h are just slopped at the top of this file, that extern would then be modifying typedef struct queueentry, and that would contribute to this chain of errors that you see.
Thanks, I’ll work on that now and see if it goes away.
-
03-16-2008
#6
Registered User
I checked common.h. I don’t see anything wrong with it. =/
common.h:
Code:
//#define DEBUG // turns on debug // prevents multiple inclusions of header file #ifndef COMMON_H #define COMMON_H #include <stdio.h> #include <stdlib.h> #include <string.h> typedef enum boolean {FALSE, TRUE} Boolean; void Error(char *); void Warning(char *); #endif
-
03-16-2008
#7
and the Hat of Guessing
I can’t reproduce the error here. I had forgotten that «typedef» is technically a storage class specifier, so that’s what’s being complained about. Somehow, the compiler thinks it’s looking at a function there.
Is that really your common.h? Why all the includes then? I don’t know if you can get away with it with your setup; but try taking it out (copying the enum declaration into your source).
-
03-16-2008
#8
Hurry Slowly
typedef struct queueentry
should be
Code:
typedef struct queueentry {
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
� David J. Wheeler
-
03-16-2008
#9
Registered User
Originally Posted by vart
typedef struct queueentry
should be
Code:
typedef struct queueentry {
Thanks! However, it is still producing the same error. =/
-
03-16-2008
#10
Registered User
Originally Posted by tabstop
I can’t reproduce the error here. I had forgotten that «typedef» is technically a storage class specifier, so that’s what’s being complained about. Somehow, the compiler thinks it’s looking at a function there.
Is that really your common.h? Why all the includes then? I don’t know if you can get away with it with your setup; but try taking it out (copying the enum declaration into your source).
It was given.
-
03-16-2008
#11
Hurry Slowly
Originally Posted by aim4sky
Thanks! However, it is still producing the same error. =/
Post the compilable sample reproducing your problem.
I can compile both your h-files without problems…Do you have something included before them in your c-file?
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
� David J. Wheeler
-
03-16-2008
#12
Registered User
The error I am getting is:
cc -c -o radix.o radix.c
In file included from radix.c:12:
queue_linked.h:20: error: storage class specified for parameter âQueueEntryâ
queue_linked.h:23: error: expected specifier-qualifier-list before âQueueEntryâ
queue_linked.h:25: error: storage class specified for parameter âQueueNodeâ
queue_linked.h:28: error: expected specifier-qualifier-list before âQueueNodeâ
queue_linked.h:31: error: storage class specified for parameter âQueueâ
queue_linked.h:33: error: expected ââ before â*â token
make: *** [radix.o] Error 1radix.c (line 12 is in red):
Code:
#include <stdio.h> #include <stdlib.h> #include <string.h> #include "common.h" #include "genlist.h" #include "queue_linked.h" #include "sort.h" void Introduction(void); void Help(void); char GetCommand(void); void DoCommand(char, List*); int main(void) { List list; Introduction(); CreateList(&list); /*endless loop: DoCommand() will call exit() to end the program. */ while(TRUE) DoCommand(GetCommand(), &list); return 1; //This statement should never be executed. } /*=======================================*/
I’ve tried putting «queue_linked.h» before «genlist.h». This gives me a similiar compling error.
Then I’ve tried putting «common.h» at the end and it still gives me the same compling error.The source code is big. If you need the rest, I’ll post it.
Thanks for helping!Last edited by aim4sky; 03-17-2008 at 12:00 AM.
-
03-17-2008
#13
Hurry Slowly
You should start with compiling only one header at a time
create c-file like
Code:
#include "queue_linked.h" int main(void) { return 0; }
and compile it
then replace queue_linked with each header in your project and see — if each one can be compiled by itself
All problems in computer science can be solved by another level of indirection,
except for the problem of too many layers of indirection.
� David J. Wheeler
-
03-17-2008
#14
Registered User
Originally Posted by vart
You should start with compiling only one header at a time
create c-file like
Code:
#include "queue_linked.h" int main(void) { return 0; }
and compile it
then replace queue_linked with each header in your project and see — if each one can be compiled by itself
Thanks! I’ll do that now.
-
03-17-2008
#15
Registered User
when I complie the following:
Code:
#include "genlist.h" int main(void) { return 0; }
I get this error:
4: error: expected â;â, â,â or ââ before â{â token
when I compile this:
Code:
#include "sort.h" int main(void) { return 0; }
I get the following error:
In file included from sort.h:9,
from sortt.c:1:
queue_linked.h:20: error: storage class specified for parameter âQueueEntryâ
queue_linked.h:23: error: expected specifier-qualifier-list before âQueueEntryâ
queue_linked.h:25: error: storage class specified for parameter âQueueNodeâ
queue_linked.h:28: error: expected specifier-qualifier-list before âQueueNodeâ
queue_linked.h:31: error: storage class specified for parameter âQueueâ
queue_linked.h:33: error: expected ââ before â*â token
sort.h:
Code:
#include "common.h" #include "genlist.h" #include "queue_linked.h" #define MAXQUEUEARRAY 28 void RadixSor(List *); int QueuePosition(char); void Rethread(List *, Queue);
I have a C code written. When I compile it on Linux then in the header file it says the
following error: storage class specified for parameter i32 , i8
and so on
typedef int i32;
typedef char i8;
8 Answers
Chances are you’ve forgotten a semicolon in a header file someplace. Make sure each line ends in ;
i had the same experience. The problem was at the function prototype declaration in the header file where a semi colon was missing at the end of function declaration.
The function was indicated in the compilation logs as «In function … » just before the error snippet
Hope this helps!!
You have some code somewhere, probably indicated in the full text of the error message, that does something like this:
void function(static int foo)
The static
is not allowed there. It could also be another storage class, like register
or extern
.
I incurred this same error once. The solution was to browse around files and look for pending statements (like a non-closed parenthesis, or a missing semicolon.) Usually it’s really a trivial error, but the compiler complains.
The bad news is that it doesn’t always complain at the right line (or even in the right file!) The good news is that in these cases it says something useful like:
WRONGFILE.h: In function ‘FUNCTION_OF_ANOTHER_FILE_WRT_WRONG_FILE’"
WRONGFILE:line:col: error: storage class specified for parameter ‘param’ before.
Go and check in that other reported file.
To add up on ;
: another case can be a missing )
in a function pointer declaration:
extern void init_callbacks(void (*init)(), void (*end());
(missing closing parenthesis after *end
).
If you are using vim editor, you can easily find missing semicolon by typing:
/[^;]s*$
…and then jump up/down (with N/n), until problematic line is found.
I had similar issue, while error was missing the storage class name in static assignment. E.g.:
.h:
class MyClass {
static const int something;
}
.cpp:
const int something = 1; // returns error
const int MyClass::something = 1; // OK
As Mawg pointed out in a comment, declaring a class member function as extern
can cause similar issues.
I have a C code written. When I compile it on Linux then in the header file it says the following error: storage class specified for parameter i32 , i8
and so on
typedef int i32;
typedef char i8;
Chances are you’ve forgotten a semicolon in a header file someplace. Make sure each line ends in ;
Related Articles
Hibernation No value specified for parameter
I have a named query that retrieves UgAcyearExamSchedule interms of a LIST as follows: @NamedQuery(name=»UgAcyearExamSchedule.getByDetail», query=»select u FROM UgAcyearExamSchedule u where u.ugAcyearExamScheduleDetails=:ugDetails») wh
Error in VB.NET code: & ldquo; Argument not specified for parameter & rdquo;
When I place Set_Symbol() in my code it give me two errors. Errors: Argument not specified for parameter ‘e’ of ‘Private Sub Set_Symbol(sender As Object, e As System.EventArgs)’. d:documentsvisual studio 2010ProjectsMath GameMath Gamefrmindex.v
In the declaration, should a storage class specifier be placed?
For example, let’s consider the static storage class specifier. Here are a few examples of both valid and ill-formed uses of this storage class specifier: static int a; // valid int static b; // valid static int* c; // valid int static* d; // valid i
The behavior of the compiler and the registry storage class specifier «& ldquo;» are obsolete & rdquo;
I’m testing some C++ code with -std=c++11. I noticed a warning I had not seen before: ‘register’ storage class specifier is deprecated What does the standard say about this (other than its deprecated)? Is it implementation defined? Will compilers tak
Hibernate exception ‘No value specified for parameter 2’ when running grails 1.3.7
I am running into an odd problem with my application. The app was developed and tested with HSQLDB, and worked fine. When I built a WAR file & deployed it on a server, one particular bit of code (crucial to the app, of course) failed. The code def as
SQLException in java: No value specified for parameter 2
I’m having trouble with solving this problem :/. When I run my project I encounter the error code: no value specified for parameter 2, even though all parameters should be filled in. public Field geefVeld(int x, int y, String spelname, int spelbordnr
& ldquo; Warning: Storage Class Specifier Not Needed in Blank Declaration & rdquo; educate
typedef struct item { char *text; int count; struct item *next; }; So I have this struct with nodes defined as above, but Im getting the error below and Im not able to figure out whats wrong. warning: useless storage class specifier in empty declarat
Disable the storage class specifier «register» is deprecated & rdquo; Warning
With the recent Xcode 5.1 update we’re getting a bunch of new warnings in our code base — this is apparently related to an updated version of clang that now warns about usages of the register storage class specifier in C++11 sources as it has been de
external storage class specifier
Section 7.1 of the C++ Standard mentions about ‘extern’ as a storage class specifier. N3126 — «The extern specifier can be applied only to the names of variables and functions. The extern specifier cannot be used in the declaration of class members o
Can the ‘auto’ keyword be used as a storage class specifier in C ++ 11?
Can the auto keyword be used as a storage class specifier in C++11? Is the following code legal in C++11? int main() { auto int x; } No the code is ill-formed in C++11. auto in C++11 would be used to deduce the type of a variable from its initializer
PHP / MySQL error: Attention: mysql_fetch_assoc () waits for parameter 1 to be a resource
This question already has an answer here: mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 to be resource or mysqli_result, boolean given 33 answers I’ve read the other questions. The error has been posted before ofcou
SQL Expression Error — Warning: sqlite_query () waits for parameter 1 to be a resource, given string
Having a strange problem with my php code when i try and insert a record into my database. $db=sqlite_open(«Architect.db»); $CustomerNo = sqlite_query($db, «SELECT MAX(CustomerNo) FROM Customer»); $row=sqlite_fetch_array($CustomerNo);
JDK8 — Error & ldquo; class file for javax.interceptor.InterceptorBinding not found & rdquo; trying to generate javadoc using Maven javadoc plugin
I am using JDK8 (tried it on my Eclipse workspace with Win x64 u25 JDK + on Linux launched by Jenkins — jdk-8u20-linux-x64, same problem for both). I have multi-module Maven project (I am launching Maven goal «javadoc:aggregate» from a main modu
PHP mysql error: & ldquo; mysql_fetch_assoc () waits for parameter 1 to be a resource, a boolean given in & rdquo;
First of all let me say I have looked around and found similar posts like this but none of them are helping me so this is why I am asking you help. Using PHP, I am trying to execute two SQL queries. First query does a Select statement with INNER JOIN