Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to increment extern variable #202

Closed
Tracked by #172
frgomes opened this issue Jun 26, 2016 · 1 comment
Closed
Tracked by #172

Failure to increment extern variable #202

frgomes opened this issue Jun 26, 2016 · 1 comment

Comments

@frgomes
Copy link

frgomes commented Jun 26, 2016

https://github.com/frgomes/scala-native-testsuite/blob/master/testsuite/0202/src/main/scala/issue0202.scala

package scala.scalanative
package native


@extern
object getopt {
  var optarg: CString = extern
  var optind: CInt    = extern
  var opterr: CInt    = extern
  var optopt: CInt    = extern

  def getopt(argc: CInt, argv: Ptr[CString], optstring: CString): CInt = extern

  def getopt_long     (argc: CInt, argv: Ptr[CString], optstring: CString, longopts: Ptr[option], longindex: Ptr[CInt]): CInt = extern
  def getopt_long_only(argc: CInt, argv: Ptr[CString], optstring: CString, longopts: Ptr[option], longindex: Ptr[CInt]): CInt = extern

  @struct
  class option(val name:    CString,
               val has_arg: CInt,
               val flag:    Ptr[CInt],
               val `val`:   CInt)
}
object Main {
  def main(args: Array[String]): Unit = {
    import scala.scalanative.native.getopt._
    optind = optind + 1
  }
}
@densh densh added the bug label Jun 26, 2016
@densh densh added this to the M3 milestone Jun 26, 2016
@densh
Copy link
Member

densh commented Jun 26, 2016

Thanks for the report!

@densh densh modified the milestones: M3, M4 Jul 1, 2016
@densh densh added the interop label Nov 25, 2016
@densh densh modified the milestones: Backlog, 0.1 Feb 21, 2017
@densh densh modified the milestones: 0.2, Backlog Mar 13, 2017
@densh densh modified the milestones: 0.2, Backlog Apr 10, 2017
@densh densh modified the milestones: 0.4, Backlog May 20, 2017
@densh densh modified the milestones: 0.4, Backlog Jan 9, 2018
jonas added a commit to scala-native/scala-native-bindgen that referenced this issue Jun 28, 2018
Due to scala-native/scala-native#202 it is not possible to use `var` so
for now `val`s are used although not semantically correct.

References #70
jonas added a commit to scala-native/scala-native-bindgen that referenced this issue Jun 28, 2018
Due to scala-native/scala-native#202 it is not possible to use `var` so
for now `val`s are used although not semantically correct.

References #70
jonas added a commit to jonas/scala-native that referenced this issue Sep 8, 2018
Implement the unsupported assignment case in
NirGetnExpr.genApplyExternAccessor. As a bonus, add bindings for
getopt.h and use it to test the interoperability.
jonas added a commit to jonas/scala-native that referenced this issue Sep 21, 2018
Implement the unsupported assignment case in
NirGetnExpr.genApplyExternAccessor. As a bonus, add bindings for
getopt.h and use it to test the interoperability.
@densh densh closed this as completed in da270f1 Oct 8, 2018
@densh densh modified the milestones: Backlog, 0.4.0 Oct 8, 2018
densh pushed a commit to densh/scala-native that referenced this issue Mar 21, 2019
…ative#1348)

Implement the unsupported assignment case in
NirGetnExpr.genApplyExternAccessor. As a bonus, add bindings for
getopt.h and use it to test the interoperability.
densh pushed a commit to densh/scala-native that referenced this issue Mar 21, 2019
…ative#1348)

Implement the unsupported assignment case in
NirGetnExpr.genApplyExternAccessor. As a bonus, add bindings for
getopt.h and use it to test the interoperability.
densh added a commit that referenced this issue Mar 21, 2019
Implement the unsupported assignment case in
NirGetnExpr.genApplyExternAccessor. As a bonus, add bindings for
getopt.h and use it to test the interoperability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants