Bug 151 – Pragma without ';' results in undefined symbols

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-05-23T02:38:00Z
Last change time
2014-02-15T13:21:12Z
Assigned to
bugzilla
Creator
lio+bugzilla

Comments

Comment #0 by lio+bugzilla — 2006-05-23T02:38:06Z
>type main.d import std.stdio;//needs at least 1 import pragma(lib,"ws2_32.lib")//; class bla{} void main(){} >dmd main.d C:\dmd\bin\..\..\dm\bin\link.exe main,,,user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved main.obj(main) Error 42: Symbol Undefined __Class_4main3bla --- errorlevel 1
Comment #1 by smjg — 2006-05-24T09:38:03Z
If the semicolon is omitted, then the pragma modifies the declaration or statement that immediately follows it, in this case the class bla. But it would appear from the spec that pragma(lib) is valid only on its own. It is indeed absurd that it behaves as it does, but in reality (AIUI) it shouldn't compile at all.
Comment #2 by bugzilla — 2006-05-25T04:24:39Z
Fixed 0.158