Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29062 Discussions

Misaligned fields aborts compilation - but should it?

warwickb
Beginner
759 Views
I am trying to compile f90SQLStructures.f90 from Canaimasoft but get the message that SQL_INTERVAL_STRUCT contains one or more misaligned fields. It is a compulsory warning in Visual Studio .NET 2003 when "unaligned data" are detected and, apparently, a fatal error. I wrote to Canaimasoft who replied that it should not be an obstacle to compilation:"The misalignment warning message can be ignored, it should not stop the compiler from creating the object code. The warning simply means that the record is not aligned in the memory as a multiple of the word size of the system. This would only have an effect on performance. "

Is this an error on the part of the programmer or the compiler?
0 Kudos
5 Replies
TimP
Honored Contributor III
759 Views
If you are compiling for IA64, it's a fatal error for sure. There's no provision for fixing up alignments at run time. If you're on 32-bit Windows, does the problem depend on whether you give an SSE compilation switch? If you aren't permitted to show us what's going on, this doesn't make a very good subject for forum posting.
0 Kudos
warwickb
Beginner
759 Views
Thanks for the hint re SSE compiler switch. I couldn't find it but had some interesting reading doing so. I did find /align:nosequence but it produced a compiler error when I used "VS .NET 2003" in the "Custom Build Step" tab on my Windows 2000 PC.

The following is code that produces the same error:
module Error1

! use f90SQLConstants
integer,parameter:: SQLSMALLINT_KIND=2
integer,parameter:: SQLINTEGER_KIND=4
!SQL structures
Type MGT_STRUCT
SEQUENCE
integer(SQLINTEGER_KIND):: district
integer(SQLINTEGER_KIND):: plntn
End Type MGT_STRUCT

Type PLOT_STRUCT
SEQUENCE
integer(SQLINTEGER_KIND):: dist_plntn
integer(SQLINTEGER_KIND):: PlYr
integer(SQLINTEGER_KIND):: Species
integer(SQLINTEGER_KIND):: Plot_No
integer(SQLINTEGER_KIND):: Tree
end type PLOT_STRUCT

Type PRODUCE_STRUCT
SEQUENCE
integer(SQLINTEGER_KIND)::product_type
integer(SQLSMALLINT_KIND)::product_vol
UNION
MAP
type(MGT_STRUCT)::Distrct_Plntn
END MAP
MAP
type(PLOT_STRUCT)::Distrct_Tree
END MAP
END UNION

END Type PRODUCE_STRUCT

end module Error1

I have found a way of using the provided .obj files so it seems that I can move on - when I can figure out how to debug with 'Kind' type variables!
0 Kudos
Steven_L_Intel1
Employee
759 Views
Do you perhaps have the compiler set to turn warnings into errors? Have you enabled the "All" warnings option?
Since you are using the IDE, please go to the Fortran property page for the project, select Command Line, and post what is shown there.
0 Kudos
warwickb
Beginner
759 Views
The compiler switches are:
/nologo /Zi /Od /warn:all /warn:declarations /warn:unused /warn:ignore_loc /warn:truncated_source /iface:cvf /module:"$(INTDIR)/" /object:"$(INTDIR)/" /traceback /check:bounds /libs:qwin /dbglibs /c

I did include this in the first version but when it didn't register (presumably because I took too long to construct it?) I forgot the second time - sorry.

Warwick
0 Kudos
Steven_L_Intel1
Employee
759 Views
Get rid of /warn:all
0 Kudos
Reply