error 1000: Unexpected symbol

Hi All,
I have a code which is used for conversion from binary to ASCII.
This code works absolutely fine on Linux and Solaris
And the same is giving many errors and warnings on HPUX. The machine on which i am compliing is "HP-UX kautilya B.11.11 U 9000/800 876920620 unlimited-user license"

Below I have pasted the errors i get on compiling

cc: "converter.c", line 865: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 915: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 870: error 1588: "size" undefined.
cc: "converter.c", line 870: error 1566: Test expression in for must be scalar.
cc: "converter.c", line 919: error 1588: "first" undefined.
cc: "converter.c", line 925: error 1566: Test expression in for must be scalar.
cc: "converter.c", line 929: error 1560: Modifiable lvalue required with operator "++".
cc: "converter.c", line 931: error 1588: "j" undefined.
cc: "converter.c", line 931: error 1564: Expression in while must be scalar.
cc: "converter.c", line 934: error 1560: Modifiable lvalue required with operator "++".
cc: "converter.c", line 941: error 1000: Unexpected symbol: "else".
cc: "converter.c", line 948: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 948: error 1584: Inconsistent type declaration: "cur_add".
cc: "converter.c", line 953: warning 558: Empty declaration.
cc: "converter.c", line 965: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 965: error 1584: Inconsistent type declaration: "blkSize".
cc: "converter.c", line 965: error 1521: Incorrect initialization.
cc: "converter.c", line 968: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 968: error 1584: Inconsistent type declaration: "version".
cc: "converter.c", line 968: error 1521: Incorrect initialization.
cc: "converter.c", line 971: error 1000: Unexpected symbol: "if".
cc: "converter.c", line 969: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 969: error 1584: Inconsistent type declaration: "verval".
cc: "converter.c", line 969: error 1521: Incorrect initialization.
cc: "converter.c", line 972: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 973: error 1584: Inconsistent type declaration: "blkSize1".
cc: "converter.c", line 973: error 1521: Incorrect initialization.
cc: "converter.c", line 974: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 974: error 1584: Inconsistent type declaration: "blkSize1".
cc: "converter.c", line 974: warning 604: Pointers are not assignment-compatible.
cc: "converter.c", line 974: warning 563: Argument #1 is not the correct type.
cc: "converter.c", line 974: warning 604: Pointers are not assignment-compatible.
cc: "converter.c", line 974: warning 563: Argument #2 is not the correct type.
cc: "converter.c", line 974: error 1521: Incorrect initialization.
cc: "converter.c", line 977: error 1000: Unexpected symbol: "}".
cc: "converter.c", line 975: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 975: error 1584: Inconsistent type declaration: "blockSize".
cc: "converter.c", line 975: error 1521: Incorrect initialization.
cc: "converter.c", line 980: error 1573: Type of "blockSize" is undefined due to an illegal declaratio
cc: "converter.c", line 980: error 1584: Inconsistent type declaration: "blockSize".
cc: "converter.c", line 980: error 1521: Incorrect initialization.
cc: "converter.c", line 982: error 1000: Unexpected symbol: "}".
cc: "converter.c", line 981: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 991: warning 558: Empty declaration.
cc: "converter.c", line 998: error 1000: Unexpected symbol: "while".
cc: "converter.c", line 996: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 1001: error 1000: Unexpected symbol: "!=".
cc: "converter.c", line 1041: error 1000: Unexpected symbol: "if".
cc: "converter.c", line 1039: error 1573: Type of "size" is undefined due to an illegal declaration.
cc: "converter.c", line 1041: error 1508: Illegal type combination.
cc: "converter.c", line 1044: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 1047: error 1000: Unexpected symbol: "while".
cc: "converter.c", line 1045: warning 557: Missing declaration specifiers, "int" assumed.
cc: "converter.c", line 1045: error 1584: Inconsistent type declaration: "cur_add".
cc: "converter.c", line 1058: error 1000: Unexpected symbol: ";".
cc: "converter.c", line 1065: error 1000: Unexpected symbol: "for".
cc: "converter.c", line 1063: error 1573: Type of "size" is undefined due to an illegal declaration.
cc: "converter.c", line 1063: error 1584: Inconsistent type declaration: "size".
cc: "converter.c", line 1063: error 1521: Incorrect initialization.
cc: "converter.c", line 1065: error 1000: Unexpected symbol: ";".
cc: "converter.c", line 1066: error 1000: Unexpected symbol: "{".
cc: panic 2017: Cannot recover from earlier errors, terminating.

Can anyone help me please to resolve this as the errors that have come up seems to be so unrealistic like unexpected symbol ; and {. I also checked the lines where the error is reflected. But they seem absolutely fine as per C syntax and coding standards.

Hoping for a quick response.Thanks in advance

HP-UX comes with a non ansi C compiler (for recompiling the kernel mostly...)
To compile software you would need more libraries ( quite sure) end perhaps an ANSI C:
What compiler are you using?

ant:/ $ which cc
/usr/bin/cc
ant:/ $ ls -al /usr/bin/cc
lrwxr-xr-t   1 root       sys             17 Jun 23  2003 /usr/bin/cc -> /opt/ansic/bin/cc
 

What options are you using to compile?

here is the sys detail abt cc.

$ uname -a
HP-UX kautilya B.11.11 U 9000/800 876920620 unlimited-user license

$ which cc
/usr/bin/cc

$ ls -al /usr/bin/cc
lr-xr-xr-t 1 ttsladm users 17 Sep 7 2005 /usr/bin/cc -> /opt/ansic/bin/cc

i compile the c code with -o and -D option like
cc -D FLAG -o OBJ_FILE converter.c

Try to include the -Ae option on the compile line.

e.g. cc -Ae -D FLAG -o OBJ_FILE converter.c

The -Ae option indicates Extended ANSI mode. Same as -Aa -D_HPUX_SOURCE +e.
This would define the names (macros and typedefs) provided by the HPUX
Operating System and, in addition, allow the following extensions: $ characters
in identifier names, sized enums, sized bit-fields, and 64-bit integral type
long long. ( Info From HP Knowledge base...)

The default C compiler on HPUX is next-to-useless. It is essentially a K&R compiler.
You have to pay extra to get an ANSI compiler.

VBE:
i tried to compile my code with -Ae option but errors are still comming, i am pasting a few.

$ cc -Ae -D CONVERTERFLAG -o OBJ_FILE converter.c
cc: "converter.c", line 1139: error 1000: Unexpected symbol: "{".
cc: "converter.c", line 1165: error 1000: Unexpected symbol: "else".
cc: "converter.c", line 1175: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1185: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1185: warning 563: Argument #1 is not the correct type.
cc: "converter.c", line 1185: error 1594: The sizeof operator cannot be applied to types with unknown size.
cc: "converter.c", line 1204: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1216: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1226: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1226: warning 563: Argument #1 is not the correct type.
cc: "converter.c", line 1226: error 1594: The sizeof operator cannot be applied to types with unknown size.
cc: "converter.c", line 1239: error 1588: "newstrValue" undefined.
cc: "converter.c", line 1253: error 1588: "newstrValue" undefined.

i really can't understand where the problem is in the code.

JIM:
Please can you tell me which compiler i can get installed so that i can compile the code sucessfully.

thanks in advance.

waiting for you replies

Can you type model, so we know what you are on (32 or 64 bit box)?

I am no C developper, and rarely compile using ansic, but I remember HP compiler does not like at all variables definitions that are not initialized... other compilers (IBM...) dont care ( I suspect they do the job for you.. (But not always and you can end with odd results...)

Now you could try and download a GCC bundle and give a try ( I do for GNU stuff).

What puzzles me also is the ownership of your transition link /usr/bin/cc,there are others:
/bin/cc -> /opt/ansic/bin/cc
/lib/ccom -> /opt/ansic/lbin/ccom
/bin/c89 -> /opt/ansic/bin/c89

/usr/bin/cb -> /opt/ansic/bin/cb
/usr/bin/cflow -> /opt/ansic/bin/cflow
/usr/bin/cxref -> /opt/ansic/bin/cxref
/usr/bin/endif -> /opt/ansic/bin/endif
/usr/bin/lint -> /opt/ansic/bin/lint
/usr/bin/protogen -> /opt/ansic/bin/protogen
/usr/lib/dag -> /opt/ansic/lbin/dag
/usr/lib/flip -> /opt/ansic/lbin/flip
/usr/lib/lint2 -> /opt/ansic/lbin/lint2
/usr/lib/lpfx -> /opt/ansic/lbin/lpfx
/usr/lib/nmf -> /opt/ansic/lbin/nmf

go and check what is in /opt/ansic, it should all be bin:bin r-xr-xr-x

If your compiler accepts -Ae option, you have the advanced compiler.
gcc is also available for HP UX 11.11 - I don't think it will help
Porting And Archive Centre For HP-UX

The error 1000 is: a misplaced or mismatched pair of {} characters.
Does your editor do bracket matching? Try to find the curly bracket that matches the one it is complaining about - then look to see if the correct curly bracket is available.