- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
コピーされたリンク
11 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
This might be a compiler bug we recently fixed. If you'll provide a short but complete examplr, I'll check.
Steve
Steve
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
The old module should not be a problem. We support that.
Steve
Steve
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
...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.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
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
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Yes, I meant 25h.
Jugoslav (who is 1E years old :-))
Jugoslav (who is 1E years old :-))
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Ok, we'll take a look. It is SUPPOSED to work.
Steve
Steve