- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use a bunch of constants like SQL_F_TINYINT in a module
On a line of code which uses the module
case(SQL_F_TINYINT); sizeofCol=1
I get:
Warning: Case selection values must fit within a signed 32 bit integer. Value truncated.
Can anyone tell me what this means?
I sounds like an overflow, but how?
FYI the relevant values of the constants are
integer,parameter:: SQLSMALLINT_KIND=2
integer(SQLSMALLINT_KIND),parameter:: SQL_INTEGER = 4
integer(SQLSMALLINT_KIND),parameter::SQL_C_LONG =SQL_INTEGER
integer(SQLSMALLINT_KIND), parameter:: SQL_SIGNED_OFFSET = (-20)
integer(SQLSMALLINT_KIND),parameter::SQL_F_SLONG= (SQL_C_LONG+SQL_SIGNED_OFFSET)
Thanks in adv.
Tim
On a line of code which uses the module
case(SQL_F_TINYINT); sizeofCol=1
I get:
Warning: Case selection values must fit within a signed 32 bit integer. Value truncated.
Can anyone tell me what this means?
I sounds like an overflow, but how?
FYI the relevant values of the constants are
integer,parameter:: SQLSMALLINT_KIND=2
integer(SQLSMALLINT_KIND),parameter:: SQL_INTEGER = 4
integer(SQLSMALLINT_KIND),parameter::SQL_C_LONG =SQL_INTEGER
integer(SQLSMALLINT_KIND), parameter:: SQL_SIGNED_OFFSET = (-20)
integer(SQLSMALLINT_KIND),parameter::SQL_F_SLONG= (SQL_C_LONG+SQL_SIGNED_OFFSET)
Thanks in adv.
Tim
Link Copied
11 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
FWIW, I occasionally get such messages when I accidentaly refer to an old (CVF 5.0D) .mod file within a new project. A rebuild takes care of it.
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This might be a compiler bug we recently fixed. If you'll provide a short but complete examplr, I'll check.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is the gist of the program, If I use the module as written out below, it does not produce the warning. I get
the warning if I use the module f90sqlconstants provided by Canaima which is compiled separately and used as an Object file. I do not know if I it is proper to attach the file from canaima w/o permission.
If you have the dang thing then we're cool.
Else, I will write Marco about it.
! module constants
! integer,parameter:: SQLSMALLINT_KIND=2
! integer(SQLSMALLINT_KIND),parameter:: SQL_INTEGER = 4
!
! integer(SQLSMALLINT_KIND),parameter::SQL_C_LONG =SQL_INTEGER
! integer(SQLSMALLINT_KIND), parameter:: SQL_SIGNED_OFFSET = (-20)
! integer(SQLSMALLINT_KIND),parameter::SQL_F_SLONG= (SQL_C_LONG+SQL_SIGNED_OFFSET)
! end module
use f90sqlconstants
integer(2) var
var=2
select case(var)
case(SQL_F_SLONG); write(*,*)'Jello mold'
case default
end select
end
the warning if I use the module f90sqlconstants provided by Canaima which is compiled separately and used as an Object file. I do not know if I it is proper to attach the file from canaima w/o permission.
If you have the dang thing then we're cool.
Else, I will write Marco about it.
! module constants
! integer,parameter:: SQLSMALLINT_KIND=2
! integer(SQLSMALLINT_KIND),parameter:: SQL_INTEGER = 4
!
! integer(SQLSMALLINT_KIND),parameter::SQL_C_LONG =SQL_INTEGER
! integer(SQLSMALLINT_KIND), parameter:: SQL_SIGNED_OFFSET = (-20)
! integer(SQLSMALLINT_KIND),parameter::SQL_F_SLONG= (SQL_C_LONG+SQL_SIGNED_OFFSET)
! end module
use f90sqlconstants
integer(2) var
var=2
select case(var)
case(SQL_F_SLONG); write(*,*)'Jello mold'
case default
end select
end
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tim, if you open the file f90sqlconstants.mod in Visual Studio (as binary file), what are bits 25-28? All my modules built with CVF6.6 have 26 2E 36 00 = "6.6"C, and I guess this is the compiler version signature (old 5.0 header files have zeros). I'd guess Canaimasoft supplied some older .mod files; if you have the sources of F90SQL, I'd suggest you recompile them and put the new .mod files back into their directory. And, yes, tell Marco about the problem.
Jugoslav
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The old module should not be a problem. We support that.
Steve
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not 100% I'm affraid. OK, here we go. I have only 5.0D and 6.6B to experiment with so I can't comment on other inter-versions, but if I compile low-level modules with 5.0D first:
Jugoslav
MODULE XFTTYPES ... INTEGER,PARAMETER:: XPROC_DIALOG = -1 ... END MODULEand then higher-level modules with 6.6B:
MODULE XFTWND USE XFTTYPES ... CONTAINS ... RECURSIVE INTEGER FUNCTION PXDefProc) ... SELECT CASE (xWnd%lpWindowProc) ... CASE (XPROC_DIALOG) !Dialog window PXDefProc = 0 ...I get:
D:...SourceXFTWnd.f90(1748) : Error: The case-value is out-of-range. CASE (XPROC_DIALOG) !Dialog window ------------^that happens for negative PARAMETERs only. It's not identical as Tim's case, but looks suspiciously similar.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
...and I'm certain I saw the same warning as Tim under similar circumstances, but at the moment I can't recall what they were exactly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok I tried including the source and force recompiling it and the warning want away.
Jugo's msg did not say bit 25h or decimal so I could not verify his hint, for sure. if he meant hex then, yes, they were all zeros in the mod file.
Does this convince Steve?
Thanks,
tim
Jugo's msg did not say bit 25h or decimal so I could not verify his hint, for sure. if he meant hex then, yes, they were all zeros in the mod file.
Does this convince Steve?
Thanks,
tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I meant 25h.
Jugoslav (who is 1E years old :-))
Jugoslav (who is 1E years old :-))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh the hex of youth!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok, we'll take a look. It is SUPPOSED to work.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page