Bug 6165 - Enum type mismatch warnings in libnetapi.c
Enum type mismatch warnings in libnetapi.c
Status: NEW
Product: Samba 3.3
Classification: Unclassified
Component: File services
3.3.1
Sparc Solaris
: P3 normal
: ---
Assigned To: Guenther Deschner
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-05 12:46 UTC by John Center
Modified: 2009-04-01 05:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Center 2009-03-05 12:46:41 UTC
Building 64-bit binaries with Sun Studio 12, on Solaris 10 SPARC.  I see the following warnings:

"lib/netapi/libnetapi.c", line 74: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 120: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 164: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 214: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 262: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 306: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 352: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 396: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 440: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 490: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 536: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 578: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 633: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 679: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 725: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 773: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 825: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 873: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 927: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 971: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1017: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1069: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1115: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1157: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1210: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1258: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1304: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1348: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1392: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1447: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1495: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1541: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1583: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1629: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1677: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1730: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1778: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1826: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1881: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1929: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 1971: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2017: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2061: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2114: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2160: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2208: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2250: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2296: warning: enum type mismatch: op "="
"lib/netapi/libnetapi.c", line 2353: warning: enum type mismatch: op "="

This may be "just" warnings, but I wouldn't expect to see so many of them at one go.
Comment 1 Volker Lendecke 2009-03-05 12:53:39 UTC
I have no clue what you are compiling, but it can't be Samba 3.3.1:

wc -l lib/netapi/netapi.c
348 lib/netapi/netapi.c

384 lines.

Volker
Comment 2 Volker Lendecke 2009-03-05 12:54:19 UTC
s/384/348/
Comment 3 John Center 2009-03-05 13:07:55 UTC
Not lib/netapi/netapi.c but lib/netapi/libnetapi.c:

wc -l source/lib/netapi/libnetapi.c
2355 source/lib/netapi/libnetapi.c

	-John

Comment 4 Volker Lendecke 2009-03-05 13:18:19 UTC
sorry
Comment 5 Derrell Lipman 2009-03-31 07:56:09 UTC
enum NET_API_STATUS is declared locally in librpc/gen_ndr/libnetapi.h. This enum is used in the definition of the out struct of, for example, struct NetJoinDomain also in libnetapi.h

In source/lib/netapi/libnetapi.c, NetJoinDomain(), for example, declares a struct NetJoinDomain and returns its out.result field, that enum NET_API_STATUS. This does not match the declared return type of NetJoinDomain() which is the type (not enum) NET_API_STATUS which itself is a different enum defined in lib/netapi/netapi.h. 

Although enums are technically ints, returning an enum of a different type is indicative of a possible bug, so the warning is reasonable. Can this code change to use the same enum for both the return value and the declared return type of the functions?

Changing component to File Services and reasigning to default assignee.
Comment 6 Guenther Deschner 2009-04-01 05:50:13 UTC
Derrell, I'm taking this one.